SA-MP Forums Archive
NEED HELP WITH THIS..... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NEED HELP WITH THIS..... (/showthread.php?tid=253309)



NEED HELP WITH THIS..... - [$A$]W33D$P33D - 05.05.2011

I need it to respawn the cars immediately after delete


COMMAND:clearcars(playerid, params[])
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,COLOUR_RED,"This command is not avaliable to you!");
{
SendClientMessageToAll(COLOUR_RED,"[SYSTEM]: All cars have been deleted!");
for(new veh;veh < MAX_VEHICLES; veh++)
{
if(!IsVehicleInUse(veh)) DestroyVehicle(veh);
}
}
return 1;
}


Re: NEED HELP WITH THIS..... - Laronic - 05.05.2011

This command work fine for me!

Make sure you login as rcon :P
pawn Код:
COMMAND:clearcars(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOUR_RED, "This command is not avaliable to you!");
    {
        for(new v = 0; v < MAX_VEHICLES; v++)
        {
            if(!IsVehicleInUse(v))
            {
                SetVehicleToRespawn(v);
                SendClientMessageToAll(COLOUR_RED, "[SYSTEM]: All cars have been respawned!")
            }
        }
    }
    return 1;
}



Re: NEED HELP WITH THIS..... - [$A$]W33D$P33D - 05.05.2011

ty dude that helped as just wondering where to put it lol your awsome


Re: NEED HELP WITH THIS..... - Laronic - 05.05.2011

Put it under your other commands :P

Open PAWNO
Open your GameMode
CTRL + F
Enter "COMMAND:"
then out the command above that like this

pawn Код:
COMMAND:something(playerid, params[])
{
    //Something
    return 1;
}

COMMAND:clearcars(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOUR_RED, "This command is not avaliable to you!");
    {
        for(new v = 0; v < MAX_VEHICLES; v++)
        {
            if(!IsVehicleInUse(v))
            {
                SetVehicleToRespawn(v);
                SendClientMessageToAll(COLOUR_RED, "[SYSTEM]: All cars have been respawned!")
            }
        }
    }
    return 1;
}
You dont need to add it in a callback or something, you can actally put it whereever you want


Re: NEED HELP WITH THIS..... - [$A$]W33D$P33D - 05.05.2011

lol no dude just this part

SetVehicleToRespawn(v);


Re: NEED HELP WITH THIS..... - [$A$]W33D$P33D - 05.05.2011

hehe im not stupid lol