Only one siren allowed on server
#5

I use
pawn Код:
new Siren[MAX_VEHICLES];
new SirenObject[MAX_VEHICLES];
 

CMD:siren(playerid, params[])
{
    new siren[65];
    new VID = GetPlayerVehicleID(playerid);
    new string[128];
    if(strcmp(siren, "inside", true, strlen(siren)) == 0)
    {
        if(Siren[VID] == 0)
        {
            Siren[VID] = 1;
            SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
            AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
            format(string, sizeof(string), "* %s puts the siren on the dashboard.", GetPlayerNameEx(playerid));
            SendNearbyMessage(playerid, 30, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        else
        {
            return SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!");
        }
    }
}
return 1;
And works fine.
You can use this code. Or try to use [MAX_VEHICLES] instead of [MAX_PLAYERS]
Reply


Messages In This Thread
Only one siren allowed on server - by lramos15 - 02.08.2013, 17:40
Re: Only one siren allowed on server - by Dokins - 02.08.2013, 17:43
Re: Only one siren allowed on server - by SMCentral - 02.08.2013, 17:48
Re: Only one siren allowed on server - by lramos15 - 02.08.2013, 18:33
Re: Only one siren allowed on server - by Facerafter - 02.08.2013, 20:36
Re: Only one siren allowed on server - by lramos15 - 16.08.2013, 18:17
Re : Only one siren allowed on server - by yusei - 16.08.2013, 18:37

Forum Jump:


Users browsing this thread: 1 Guest(s)