20.01.2010, 23:14
TRANCAR
DESTRANCAR O VEICULO
[b]Espero que esse tutorial seja utiu para quem esta atras.
pawn Code:
if (strcmp(cmdtext, "/OCOMANDOPARA TRANCAR", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xFF004040,"Vocк pode Trancar sу as portas como o motorista.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
}
}
SendClientMessage(playerid, 0x33AA33AA, "Veiculo Trancado");
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid,1056,pX,pY,pZ);
}
else
{
SendClientMessage(playerid, 0xFF004040, "Voce Nao Esta Em Um veiculo);
}
return 1;
pawn Code:
if (strcmp(cmdtext, "/COMANDO PARA DESTRANCAR, true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xFF004040,"Vocк pode destrancar sу as portas como o motorista);
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
}
SendClientMessage(playerid, 0x33AA33AA, Veiculo Trancado!");
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid,1057,pX,pY,pZ);
}
else
{
SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
}
return 1;
}