that you use in the dialog the pickup name and the string have the same name, that's what's causing the error...
. (I already inserted the function into your cmd)
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;
}
else
{
switch(strval(params))
{
case 1:
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), -1935.985, 231.728, 34.1546);
}
else
{
SetPlayerPos(playerid, -1935.985, 231.728, 34.1546);
}
new dsname[MAX_PLAYER_NAME];
new string[182];
GetPlayerName(playerid, dsname, sizeof(dsname));
format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 1", dsname);
SendClientMessageToAll(COLOR_YELLOW, string);
GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 1", 3000, 4);
return 1;
}
case 2:
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2709.731, 217.423, 4.179);
}
else
{
SetPlayerPos(playerid, -2709.731, 217.423, 4.179);
}
new dsname[MAX_PLAYER_NAME];
new string[182];
GetPlayerName(playerid, dsname, sizeof(dsname));
format(string, sizeof(string), "%s has just teleported to Tune 2 /Tune 2", dsname);
SendClientMessageToAll(COLOR_YELLOW, string);
GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 2", 3000, 4);
return 1;
}
case 3:
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2386.802, 1036.320, 10.280);
}
else
{
SetPlayerPos(playerid, 2386.802, 1036.320, 10.280);
}
new dsname[MAX_PLAYER_NAME];
new string[182];
GetPlayerName(playerid, dsname, sizeof(dsname));
format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 3", dsname);
SendClientMessageToAll(COLOR_YELLOW, string);
GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 3", 3000, 4);
return 1;
}
case 4:
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 2644.976, -2030.903, 13.554);
}
else
{
SetPlayerPos(playerid, 2644.976, -2030.903, 13.554);
}
new dsname[MAX_PLAYER_NAME];
new string[182];
GetPlayerName(playerid, dsname, sizeof(dsname));
format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 4", dsname);
SendClientMessageToAll(COLOR_YELLOW, string);
GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 4", 3000, 4);
return 1;
}
}
}
return 1;
}