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; } |
new Carro[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/zr350", cmdtext, true, 10) == 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(playerid, Carro[playerid], 0);
return 1;
}
return 0;
}
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;
}
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(playerid, Carro[playerid], 0);
return 0x01;
}
//OnPlayerDisconnect:
if(Carro[playerid] > 0) DestroyVehicle(Carro[playerid);