if(!strcmp(cmdtext, "/goto lasventuras 3", true))
{
SetPlayerPos(playerid,floatx,floaty,floatz);
return 1;
}
if(!strcmp(cmdtext, "/goto lasventuras 4", true))
{
SetPlayerPos(playerid,floatx,floaty,floatz);
return 1;
}
Originally Posted by ►►►Peter Corneile◄◄◄
pawn Код:
And so on .... |
// FOLLOWING ARE JUST FOR EXAMPLES, MODIFY THEM AS NEEDED !
new Float:LSTeles[3][5] =
{
{X, Y, Z, A, INT},
{X, Y, Z, A, INT},
{X, Y, Z, A, INT}
};
new Float:SFTeles[3][5] =
{
{X, Y, Z, A, INT},
{X, Y, Z, A, INT},
{X, Y, Z, A, INT}
};
new Float:LVTeles[3][5] =
{
{X, Y, Z, A, INT},
{X, Y, Z, A, INT},
{X, Y, Z, A, INT}
};
dcmd_goto(playerid, params[])
{
new
city[32],
telenum;
if (sscanf(params, "sd", city, telenum) != 0)
{
SendClientMessage(playerid, COLOR_SERVER, "Usage: /goto <city> <location ID>");
return 1;
}
if (telenum < 0) return SendClientMessage(playerid, COLOR, "[FAIL] Location ID can not be lower than 0");
if (!strcmp(city, "ls", true, 2) || !strcmp(city, "lossantos", true, 9))
{
SetPlayerPos(playerid, LSTeles[telenum][0], LSTeles[telenum][1],LSTeles[telenum][2]);
SetPlayerFacingAngle(playerid, LSTeles[telenum][3]);
SetPlayerInterior(playerid, LSTeles[telenum][4]);
format(city, sizeof(city), "Teleported to #%d in LS.", telenum);
SendClientMessage(playerid, COLOR, city);
return 1;
}
if (!strcmp(city, "sf", true, 2) || !strcmp(city, "sanfierro", true, 9))
{
SetPlayerPos(playerid, LSTeles[telenum][0], LSTeles[telenum][1],LSTeles[telenum][2]);
SetPlayerFacingAngle(playerid, LSTeles[telenum][3]);
SetPlayerInterior(playerid, LSTeles[telenum][4]);
format(city, sizeof(city), "Teleported to #%d in SF.", telenum);
SendClientMessage(playerid, COLOR, city);
return 1;
}
if (!strcmp(city, "lv", true, 2) || !strcmp(city, "lasventuras", true, 11))
{
SetPlayerPos(playerid, LSTeles[telenum][0], LSTeles[telenum][1],LSTeles[telenum][2]);
SetPlayerFacingAngle(playerid, LSTeles[telenum][3]);
SetPlayerInterior(playerid, LSTeles[telenum][4]);
format(city, sizeof(city), "Teleported to #%d in LV.", telenum);
SendClientMessage(playerid, COLOR, city);
return 1;
}
return 1;
}