Код:
if(strcmp(cmd, "/tphousecar", true) == 0 && IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
tmp = strtok(cmdtext, idx);
new vehicleid = GetPlayerVehicleID(playerid);
new Float:X, Float:Y, Float:Z, Float:Rx;
GetVehiclePos(vehicleid, X, Y, Z);
GetVehicleZAngle(vehicleid,Rx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /tphousecar [houseid]");
return 1;
}
new HouseCar = strval(tmp);
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 105 && IsPlayerConnected(playerid))
{
HouseCarSpawns[HouseCar][hEntrancex] = X;
HouseCarSpawns[HouseCar][hEntrancey] = Y;
HouseCarSpawns[HouseCar][hEntrancez] = Z;
HouseCarSpawns[HouseCar][hEntrancerx] = Rx;
format(string, sizeof(string), "Housecar has been transported to its new location");
SendClientMessage(playerid, COLOR_WHITE, string);
OnPropUpdate();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin.");
}
return 1;
}