20.06.2009, 00:53
SilentHuntr,
when I write /cmd, all server lag..
pawn Код:
#include <a_samp>
new deathcount[MAX_PLAYERS];
//new SpawnPos[4][MAX_PLAYERS];
new Float:SpawnPos[][4] =
{
{-2796.9854, 1224.8180, 20.5429, 192.0335},
{-2454.2170, 503.8759, 30.0790, 267.2932},
{-2669.7322, -6.0874, 6.1328, 89.8853}
}
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Sumo");
print("----------------------------------\n");
}
#endif
public OnFilterScriptInit()
{
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext,"/cmd",true)==0)
{
GetPlayerPos(playerid,SpawnPos[0][playerid],SpawnPos[1][playerid],SpawnPos[2][playerid]);
deathcount[playerid]=3;
return SendClientMessage(playerid,0xFF0000FF,"You will now spawn here 3 more times.");
}
return 0;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate==PLAYER_STATE_SPAWNED)
{
if(deathcount[playerid]>0)
{
SetPlayerPos(playerid,SpawnPos[0][playerid],SpawnPos[1][playerid],SpawnPos[2][playerid]);
deathcount[playerid]--;
}
}
}