27.10.2013, 03:07
pawn Code:
// Topo do GM
new VeiculoPlayer[MAX_PLAYERS];
// OnPlayerUpdate
if(VeiculoPlayer[playerid])
{
if(!IsPlayerInAnyVehicle(playerid))
{
OnPlayerCommandText(playerid,"/dcv");
}
}
// Comando
if(strcmp(cmd, "/cv", true) == 0)
{
if(VeiculoPlayer[playerid] >= 1)
{
SendClientMessage(playerid,0xBFBFBFAA,"Use /dcv.");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessageEx(playerid, 0xBFC0C2AA, "Uso Correto: /cv [Veiculo ID]");
return 1;
}
new car = strval(tmp);
if(car < 400 || car > 611)
{
SendClientMessageEx(playerid, 0xBFBFBFAA, "IDs de 400 a 611.");
return 1;
}
new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
VeiculoPlayer[playerid] = CreateVehicle(car, X,Y,Z, 0.0, -1, -1,36000000);
return 1;
}
if(strcmp(cmd, "/dcv", true) == 0)
{
if(VeiculoPlayer[playerid] == 0)
{
SendClientMessage(playerid,0xBFBFBFAA,"Vocк nгo criou um veнculo!");
return 1;
}
SendClientMessage(playerid,0xBFBFBFAA,"O seu veнculo Foi destruнdo!");
DestroyVehicle(VeiculoPlayer[playerid]);
VeiculoPlayer[playerid] = 0;
return 1;
}