Need help with forbidden spawn.
#1

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:
Reply
#2

OnPlayerSpawn
if([pInfo][playerid][SelectedPlayer] == 1)
SetPlayerPos(playerid,x,y,z);

(Note, you need to make an enum for the pInfo stuff)
Reply
#3

How can I make that enum stuff? Never worked with that.

+ dumb question, is enum something like dini or dudb?
Reply
#4

Tbh, now thinking of it, you don't need an enum.

pawn Код:
//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)
Note: this has not been tested, but it should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)