Jump to content
  • 0

Cum pot face?


heker

Question

Salut mar interesa si p mn o idee

Dupa ce fac un checkpoint:

else if(CP[playerid] == 85)
    {
        if(IsPlayerInVehicle(playerid, 285) || IsPlayerInVehicle(playerid, 286) || IsPlayerInVehicle(playerid, 287) || IsPlayerInVehicle(playerid, 288))
      	{
	        new cashp;
	        cashp = (PlayerInfo[playerid][pLevel]*100);
	        GivePlayerMoney(playerid, cashp);
	        format(string, sizeof(string), "~g~%d$ ~w~au fost adaugati.",cashp);
	        GameTextForPlayer(playerid, string, 1000, 1);
	        DisablePlayerCheckpoint(playerid);
	        SetPlayerCheckpoint(playerid,1340.8556,-1235.6326,12.9889,5.0);
	        CP[playerid] = 86;
		}
    }

cand trec cu vehiculul respectie as dori daca se poate sa stau pe freeze 3 secunde. Se poate?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

ai doua posibilitati:

1. - Folosind functiile din 0.3C: GetVehicleParamsEx, SetVehicleParamsEx

    else if(CP[playerid] == 85)
    {
        new bool:ok = false;
        for(new i = 285; i <= 288; i++) if(IsPlayerInVehicle(playerid, i)) ok = true;
        if(ok)
      	{
	        new cashp = PlayerInfo[playerid][pLevel] * 100;
	        format(string, sizeof(string), "~g~%d$ ~w~au fost adaugati.",cashp);
	        GameTextForPlayer(playerid, string, 1000, 1);
	        DisablePlayerCheckpoint(playerid);
	        GivePlayerMoney(playerid, cashp);
	        CP[playerid] = 86;
	        SetPlayerCheckpoint(playerid,1340.8556,-1235.6326,12.9889,5.0);
	        FreezeMyVehicle(/*playerid,*/GetPlayerVehicleID(playerid));
	}
    }
   
FreezeMyVehicle(/*playerid,*/vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SetTimerEx("UnfreezeMyVehicle",3000,false,"d",vehicleid);
    //SendClientMessage(playerid,0,"{F6F2B9}Te rugam sa astepti {F07F63}3 secunde {F6F2B9}!");
}

forward UnfreezeMyVehicle(/*playerid,*/vehicleid);
public UnfreezeMyVehicle(/*playerid,*/vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
    //SendClientMessage(playerid,0,"{F07F63}Totul e in regula, poti pleca !");
}
2. - Folosind legendara functie, TogglePlayerControllable
    else if(CP[playerid] == 85)
    {
        new bool:ok = false;
        for(new i = 285; i <= 288; i++) if(IsPlayerInVehicle(playerid, i)) ok = true;
        if(ok)
      	{
	        new cashp = PlayerInfo[playerid][pLevel] * 100;
	        format(string, sizeof(string), "~g~%d$ ~w~au fost adaugati.",cashp);
	        GameTextForPlayer(playerid, string, 1000, 1);
	        DisablePlayerCheckpoint(playerid);
	        GivePlayerMoney(playerid, cashp);
	        CP[playerid] = 86;
	        SetPlayerCheckpoint(playerid,1340.8556,-1235.6326,12.9889,5.0);
	        TogglePlayerControllable(playerid, false);
	        SetTimerEx("TPG_T",3000,false,"d",playerid);
	        //SendClientMessage(playerid,0,"{F6F2B9}Te rugam sa astepti {F07F63}3 secunde {F6F2B9}!"); /* daca ai 0.3C */
	}
    }
forward TPG_T(playerid);
public TPG_T(playerid)
{
	if(!IsPlayerConnected(playerid))
	    return 0;

	TogglePlayerControllable(playerid, true);
	//SendClientMessage(playerid,0,"{F07F63}Totul e in regula, poti pleca !");  /* daca ai 0.3C */
}

Link to comment
Share on other sites

Am folosit 2 am introdus la sfarsitul gm

forward TPG_T(playerid);
public TPG_T(playerid)
{
   if(!IsPlayerConnected(playerid))
   return 0;
   TogglePlayerControllable(playerid, true);
   SendClientMessage(playerid,COLOR_YELLOW,"Totul e in regula, poti pleca !");  /* daca ai 0.3C */
}
dar cand dau compile imi da aces warning :|
D:\New Folder\Zonek\Zonek\gamemodes\eRP.pwn(40959) : warning 209: function "TPG_T" should return a value

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.