[ajuda]Respawn no carro antigo
#1

Galera й o seguinte criei um cmd para meu server de drift, que й assim oh ex:/sultan dae vc aparece em um sultan mais tipo se tu ficar usando esse cmd o carro antigo seu nгo some ta ae o cmd para me ajudarem

Quote:

if (strcmp("/zr350", cmdtext, true, 10) == 0)
{
new vehicleid;
new Float:X,Float:Y,Float:Z,Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
GetPlayerVehicleID(playerid);
vehicleid = CreateVehicle(477,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}

Ajudem aee por favor
Reply
#2

PHP код:
new Carro[MAX_PLAYERS];

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/zr350"cmdtexttrue10) == 0)
    {
        
DestroyVehicle(Carro[playerid]);
        new 
Float:X,Float:Y,Float:Z,Float:Angle;
        
GetPlayerPos(playerid,X,Y,Z);
        
GetPlayerFacingAngle(playerid,Angle);
        
Carro[playerid] = CreateVehicle(477,X,Y,Z,Angle,-1,-1,600);
        
PutPlayerInVehicle(playeridCarro[playerid], 0);
        return 
1;
    }
    return 
0;

Desta forma o outro veiculo serб destruido.
Reply
#3

pawn Код:
new Carro[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(!strcmp("/zr350", cmdtext, true))
     {
          if(Carro[playerid] != 0 || IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Vocк jб tem um carro!");
          new Float:X, Float:Y, Float:Z, Float:Angle;
          GetPlayerPos(playerid, X, Y, Z);
          GetPlayerFacingAngle(playerid, Angle);
          Carro[playerid] = CreateVehicle(477, X, Y, Z, Angle, -1, -1, 1800000);
          PutPlayerInVehicle(playerid, Carro[playerid], 0);
          return 1;
     }
     return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
     if(oldstate == 2)
     {
          if(Carro[playerid] != 0)
          {
               DestroyVehicle(Carro[playerid]);
               Carro[playerid] = 0;
          }
     }
     return 1;
}
Reply
#4

olha aqui deu tudo isso de erro no do shadoww
www.pastebin.com/CUHWp0rg
:O
Vo testa o do DR_Pawno
Reply
#5

PHP код:



new Carro[MAX_PLAYERS] = 0x0;
    if(
strcmp(cmd"/zr350"true) == 0) {
        
DestroyVehicle(Carro[playerid]);
        new 
Float:Pos[4];
        
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        
GetPlayerFacingAngle(playerid,Pos[3]);
        
Carro[playerid] = AddStaticVehicle(477,Pos[0],Pos[1],Pos[2],Pos[3],-1,-1,60000);
        
PutPlayerInVehicle(playeridCarro[playerid], 0);
        return 
0x01;

    }
    
//OnPlayerDisconnect:

    
if(Carro[playerid] > 0DestroyVehicle(Carro[playerid); 
Reply
#6

www.pastebin.com/CUHWp0rg = Unknown Paste ID!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)