"/lock" Doesn't want to work.
#2

I have a good command:
Quote:

if (strcmp(cmdtext, "/lock", true)==0)
{
new State;
new Float:X;
new Float:Y;
new Float:Z;
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_RED,"You can only lock when driving!");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i, 0, 1);
}
}
SendClientMessage(playerid, COLOR_COP_ELITE, "Vehicle Locked!");
GetPlayerPos(playerid,X,Y,Z);
PlayerPlaySound(playerid,1056,X,Y,Z);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle.");
return 1;
}
}
if (strcmp(cmdtext, "/destrancar", true)==0)
{
new State;
new Float:X;
new Float:Y;
new Float:Z;
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_RED,"You are not driving.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i, 0, 0);
}
SendClientMessage(playerid, COLOR_COP_ELITE, "Vehicle Unlocked");
GetPlayerPos(playerid,X,Y,Z);
PlayerPlaySound(playerid,1057,X,Y,Z);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in any vehicle");
return 1;
}
}

EDIT: Change the color of the messages, as are the pattern of my Game Mode

Sorry for my bad english xD
Reply


Messages In This Thread
"/lock" Doesn't want to work. - by Verlix - 07.05.2009, 21:54
Re: "/lock" Doesn't want to work. - by Xeretta - 07.05.2009, 22:08
Re: "/lock" Doesn't want to work. - by Verlix - 08.05.2009, 06:22
Re: "/lock" Doesn't want to work. - by Rks25 - 08.05.2009, 12:32
Re: "/lock" Doesn't want to work. - by Verlix - 11.05.2009, 07:02
Re: "/lock" Doesn't want to work. - by NeRoSiS - 11.05.2009, 07:11
Re: "/lock" Doesn't want to work. - by Verlix - 11.05.2009, 07:20
Re: "/lock" Doesn't want to work. - by devil614 - 13.05.2009, 01:42

Forum Jump:


Users browsing this thread: 2 Guest(s)