02.10.2009, 20:07
Aight guys, I need a new class added. The only thing is - it should NOT be accessable to everyone, just for selected players. Anyone got a idea how to do that? D:
//on the top of your script
new Special[MAX_PLAYERS];
//OnPlayerConnect
Special[playerid] = 0;
//simple command to make someone a special, using dcmd.
dcmd_special(playerid,params)
{
new giveplayerid = strval(params);
if(!params[0]) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /special [playerid]");
if(!IsPlayerConnected(giveplayerid))return SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid ID!"
if(Special[giveplayerid] == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is already special.");
Special[giveplayerid] = 1;
return 1;
}
//Under OnPlayerSpawn
if(Special[playerid] == 1) return SetPlayerPos(playerid,x,y,z)