Command needed
#1

Hello guys, i'm looking for command /veh wich spawns car with IDs for RP servers, when i respawn all cars the /veh i spawned does respawn at the location, i hope you all understood what i mean.
Reply
#2

I'm not entirely sure what you're asking, maybe something like this?
pawn Код:
new Vehicles[MAX_VEHICLES];
new VehicleAmount;
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/veh",true))
    {
        if(!IsPlayerAdmin(playerid))return 0;
        new tmp;
        new spaces[4];
        for(new cell;cell<strlen(cmdtext);cell++)if(cmdtext[cell]=' ')
        {
            space[tmp]=cell+1;
            tmp++;
        }
        if(tmp<4)return SendClientMessage(playerid,0xFF0000FF,"USAGE: /Veh [Model] [Color1] [Color2] [RespawnTime]");
        for(new error;error<4;error++)if(!space[error])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /Veh [Model] [Color1] [Color2] [RespawnTime]");
        new Float:x,Float:y,Float:z,Float:a;
        GetPlayerPos(playerid,x,y,z);
        GetPlayerFacingAngle(playerid,a);
        Vehicles[VehicleAmount] = CreateVehicle(strval(space[0]),x,y,z,a,strval(space[1]),strval(space[2]),strval(space[3]));
        VehicleAmount++;
        return SendClientMessage(playerid,0xAAAAAAFF,"Vehicle Created.");
    }
    if(!strcmp(cmdtext,"/RespawnCars",true))
    {
        if(!IsPlayerAdmin(playerid))return 0;
        for(new vehicle;vehicle<MAX_VEHICLES;vehicle++)SetVehicleToRespawn(Vehicles[vehicle]);
        return SendClientMessage(playerid,0xAAAAAAFF,"All Vehicles Respawned.");
    }
    return 0;
}
You must be rcon admin to use these commands.
Reply
#3

Can you gimme it as filter script, please ?
Also when i putted it in the GM :
Код:
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7321) : warning 217: loose indentation
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7322) : error 029: invalid expression, assumed zero
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7322) : error 029: invalid expression, assumed zero
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7327) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7329) : warning 211: possibly unintended assignment
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7331) : error 017: undefined symbol "space"
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7331) : warning 215: expression has no effect
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7331) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7331) : error 029: invalid expression, assumed zero
C:\Documents and Settings\wesso\Desktop\0.3c SAMP Server\0.2X\gamemodes\SAGC.pwn(7331) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#4

Just replace it with what he gave you, it's really not that difficult.

PHP код:
1. Open Pawno Files > New.
2. Find public  OnPlayerCommandText.
3. Replace codes
Thats it, your done.
Reply
#5

Quote:
Originally Posted by Ish
Посмотреть сообщение
Just replace it with what he gave you, it's really not that difficult.

PHP код:
1. Open Pawno Files > New.
2. Find public  OnPlayerCommandText.
3. Replace codes
Thats it, your done.
I didn't understand good, can you do it for me, please
Reply
#6

Here you go

Example Vehicle Filterscript
Brought to you by SAMP-Resources.com
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)