17.04.2013, 05:05
You should re-factor your teleport commands since all the code is basically the same.
Before
After
I don't know about you but that will save a lot of lines of code and also make it really easy to add more locations without bloating your script with copy/paste code.
One more thing
SendClientMessage(playerid,green,"ES Message: {FFFFFF}You've setted your time to {33AA33} 12:00!");
There is no such word as "setted" in the English language it would simply be "set".
Before
pawn Код:
CMD:vinewood(playerid)
{
new string[256], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s {FFFFFF}has gone to {33AA33}Vinewood (/vinewood)",pName);
SendClientMessageToAll(green,string);
if (IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), 1413.2775,-871.3857,46.9813);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
if (!IsPlayerInAnyVehicle(playerid))
{
SetPlayerPos(playerid, 1413.2775,-871.3857,46.9813);
SetPlayerInterior(playerid, 0);
}
return 1;
}
pawn Код:
CMD:vinewood(playerid) { TeleportPlayer(playerid, "Vinewood", "Vinewood", 1413.2775,-871.3857,46.9813, 0); return 1; }
CMD:lvair(playerid) { TeleportPlayer(playerid, "Las Venturas Airport", "lvair", 1318.8335,1255.4017,10.8203, 0); return 1; }
stock TeleportPlayer(playerid, LocationName[], LocationCommand[], Float:LocX, Float:LocY, Float:LocZ, InteriorID)
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s {FFFFFF}has gone to {33AA33}%s(/%s)",pName, LocationName, LocationCommand);
SendClientMessageToAll(green,string);
if (IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), InteriorID);
}
if (!IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
SetPlayerInterior(playerid, InteriorID);
}
return 1;
}
One more thing
SendClientMessage(playerid,green,"ES Message: {FFFFFF}You've setted your time to {33AA33} 12:00!");
There is no such word as "setted" in the English language it would simply be "set".