14.09.2012, 14:49
pawn Код:
CMD:tune(playerid,params[])
{
{
if(isnull(params))
{
SendClientMessage(playerid, red, " Usage: /tune [1-4] ");
SendClientMessage(playerid, red, " FUNCTION: To Teleport To The Tune Garages ");
return 1;
}
if(strcmp(params,"1",true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //They are driving a vehicle
{
SetVehiclePos(GetPlayerVehicleID(playerid), -1935.985, 231.728, 34.1546);
}
else //They are on-foot or a passenger
{
SetPlayerPos(playerid, -1935.985, 231.728, 34.1546);
new msg[999];
new dsname[MAX_PLAYER_NAME];
new string[999];
format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 1", dsname);
SendClientMessageToAll(COLOR_YELLOW, string);
format(string, sizeof(string), "~B~Welcome To ~r~Tune 1");
GameTextForPlayer(playerid, string, 3000, 4);
}
}
else if(strcmp(params,"2",true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //They are driving a vehicle
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2709.731, 217.423, 4.179);
}
else //They are on-foot or a passenger
{
SetPlayerPos(playerid, -2709.731, 217.423, 4.179);
new msg[128];
new dsname[MAX_PLAYER_NAME];
new string[128];
format(string, sizeof(string), "%us has just teleported to Tune 2 /Tune 2", dsname);
SendClientMessageToAll(yellow, msg);
format(string, sizeof(string), "~B~Welcome To ~r~Tune 2");
GameTextForPlayer(playerid, string, 3000, 4);
}
}
else if(strcmp(params,"3",true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //They are driving a vehicle
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2386.802, 1036.320, 10.280);
}
else //They are on-foot or a passenger
{
SetPlayerPos(playerid, 2386.802, 1036.320, 10.280);
new msg[128];
new dsname[MAX_PLAYER_NAME];
new string[128];
format(string, sizeof(string), "%us has just teleported to Tune 3 /Tune 3", dsname);
SendClientMessageToAll(yellow, msg);
format(string, sizeof(string), "~B~Welcome To ~r~Tune 3");
GameTextForPlayer(playerid, string, 3000, 4);
}
}
else if(strcmp(params,"4",true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //They are driving a vehicle
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2644.976, -2030.903, 13.554);
}
else //They are on-foot or a passenger
{
SetPlayerPos(playerid, 2644.976, -2030.903, 13.554);
new msg[128];
new dsname[MAX_PLAYER_NAME];
new string[128];
format(string, sizeof(string), "%us has just teleported to Tune 4 /Tune 4", dsname);
SendClientMessageToAll(yellow, msg);
format(string, sizeof(string), "~B~Welcome To ~r~Tune 4");
GameTextForPlayer(playerid, string, 3000, 4);
}
}
}
return 1;
}
BUGS
The SendCleintMessageToAll Is Not Working
Example:
/tune 1
And i Teleport But The Message Dosent Work Need help