02.09.2014, 08:06
(
Последний раз редактировалось Aasim; 02.09.2014 в 10:35.
)
Hello, my server has crashed twice after using /get, however it does not crash often so my guess would be some nickname is making it crash?
Here's the cmd for /get:
And here's the pName:
I added +10 to check if it would fix, but didn't.
Here's the cmd for /get:
Код:
CMD:get(playerid, params[])
{
if(pInfo[playerid][pAdminLevel] >= 1)
{
new player;
if(sscanf(params, "r", player))
{
SendClientMessage(playerid,CYAN,"Usage: /get <playerid/part of nick>");
return 1;
}
new string[128];
if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerInterior(player,GetPlayerInterior(playerid));
SetPlayerVirtualWorld(player,GetPlayerVirtualWorld(playerid));
if(GetPlayerState(player) == 2)
{
new VehicleID = GetPlayerVehicleID(player);
SetVehiclePos(VehicleID,x+3,y,z);
LinkVehicleToInterior(VehicleID,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(player),GetPlayerVirtualWorld(playerid));
}
else
{
SetPlayerPos(player,x+2,y,z);
}
format(string,sizeof(string),"You have been teleported to Administrator \"%e's\" location", pName(playerid));
SendClientMessage(player,CYAN,string);
----->This is the line crashing ---> format(string,sizeof(string),"You have teleported \"%e\" to your location", pName(player));
SendClientMessage(playerid,CYAN,string);
return 1;
}
else
{
SendClientMessage(playerid, RED, "Player is not connected or is yourself");
}
}
else
{
return 0;
}
return 1;
}
Код:
stock pName(playerid)
{
new gName[MAX_PLAYER_NAME+10];
GetPlayerName( playerid, gName, sizeof gName );
return gName;
}


