30.09.2012, 16:44
Hello, again some problems.
It doesn't have any errors, but it doesn't working ingame.
please help me fix this. big thank you, and respect.
It doesn't have any errors, but it doesn't working ingame.
pawn Код:
if (strcmp(cmdtext, "/locker", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xFF004040,"You can only lock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
}
}
new lock;
for(lock=0;i<MAX_PLAYERS;lock++)
if(lock == 1)
{
SendClientMessage(playerid, 0xFF004040,"Tu jau esi aizsleedzis kaadu citu transporta liidzekli.");
lock == 1;
return 1;
}
if(lock == 0)
{
SendClientMessage(playerid, 0x33AA33AA,"Transporaliidzeklis aizsleegts.");
}
SendClientMessage(playerid, 0x33AA33AA, "Vehicle locked!");
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid,1056,pX,pY,pZ);
}
else
{
SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
}
return 1;
}
if (strcmp(cmdtext, "/unlock", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xFF004040,"You can only unlock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
}
SendClientMessage(playerid, 0x33AA33AA, "Vehicle unlocked!");
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;
}
return 0;
}
}