how cand i do that
#1

i have an script on my gm with stunt event , i want to participate onlye people that have NRG or PCJ .

This is the comand /stuntevent :

Код:
if(strcmp(cmd,"/stuntevent",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
		   if(NRGStarted == 0)
		   {
               SendClientMessage(playerid, COLOR_LIGHTBLUE,"This event isn't started at the moment!");
               return 1;
		   }
		   if(PlayerOnMission[playerid] > 0)
           {
                        SendClientMessage(playerid, COLOR_GREY, " You're on mission right now,you can't hold any Materials Packages!");
                        return 1;
           }
           SetPlayerCheckpoint(playerid, NRGStuntX,NRGStuntY,NRGStuntZ, 3.0);
           IsAtStuntEvent[playerid] = 1;
           SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}••• Ai intrat la {FF9900}StuntEVENT. {FFFFFF}Du-te la checkpoint si fa {FF9900}stunt-ul!");
           return 1;
		}
	}
Reply
#2

To check if the player is in a certain vehicle you can use this functions:
Код:
if(GetPlayerVehicleID(playerid) == 522) 
{
    // The player is in a NRG-500.
}
if(GetPlayerVehicleID(playerid) == 461) 
{
    // The player is in a PCJ-600.
}
Reply
#3

and how , or where i will add what u give me .. sry but im new in scripting ...
Reply
#4

You can add it under if(PlayerOnMission[playerid] > 0).
Код:
if(GetPlayerVehicleID(playerid) == 522 || GetPlayerVehicleID(playerid) == 461) 
{
           SetPlayerCheckpoint(playerid, NRGStuntX,NRGStuntY,NRGStuntZ, 3.0);
           IsAtStuntEvent[playerid] = 1;
           SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}••• Ai intrat la {FF9900}StuntEVENT. {FFFFFF}Du-te la checkpoint si fa {FF9900}stunt-ul!");
           return 1;
}
else
{
          SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}••• You must be in a NRG-500 or PCJ-600");
}
Reply
#5

pawn Код:
if (!strcmp(cmd, "/stuntevent", true))
{
    if (!NRGStarted) return SendClientMessage(playerid, COLOR_LIGHTBLUE,"This event isn't started at the moment!");
    if (PlayerOnMission[playerid] > 0) return SendClientMessage(playerid, COLOR_GREY, " You're on mission right now,you can't hold any Materials Packages!");
   
    for (new i; i != MAX_PLAYERS; ++i)
    {
        if (!IsPlayerConnected(i)) continue;
        switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
        {
            case 461, 522:
            {
                SetPlayerCheckpoint(i, NRGStuntX,NRGStuntY,NRGStuntZ, 3.0);
                IsAtStuntEvent[i] = 1;
                SendClientMessage(i, COLOR_LIGHTBLUE, "{FFFFFF}••• Ai intrat la {FF9900}StuntEVENT. {FFFFFF}Du-te la checkpoint si fa {FF9900}stunt-ul!");
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)