SA-MP Forums Archive
[ajuda]Respawn no carro antigo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda]Respawn no carro antigo (/showthread.php?tid=263323)



[ajuda]Respawn no carro antigo - Andrew_Guiga - 21.06.2011

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


Re: [ajuda]Respawn no carro antigo - Shadoww5 - 21.06.2011

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.


Re: [ajuda]Respawn no carro antigo - Dr_Pawno - 21.06.2011

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;
}



Re: [ajuda]Respawn no carro antigo - Andrew_Guiga - 21.06.2011

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


Re: [ajuda]Respawn no carro antigo - Ricop522 - 21.06.2011

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); 



Re: [ajuda]Respawn no carro antigo - Shadoww5 - 21.06.2011

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