SA-MP Forums Archive
read! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: read! (/showthread.php?tid=175410)



read! - thomas.. - 09.09.2010

soooo

say if ppl do a cmd and their player id is 0 they get teled to one place, playerid 1 the other, and so on..

how to do?




Re: read! - miokie - 09.09.2010

Quote:
Originally Posted by thomas..
Посмотреть сообщение
soooo

say if ppl do a cmd and their player id is 0 they get teled to one place, playerid 1 the other, and so on..

how to do?

Код:
if(playerid == 0) //For Id 0
{
//SetPlayerPos etc...
}
else if(playerid == 1) //For Id 1
{
//setplayerpos etc...
}
else if(playerid == 2) //For Id 2
{
//setplayerpos etc...
}
else if etc...



Re: read! - thomas.. - 09.09.2010

Quote:
Originally Posted by miokie
Посмотреть сообщение
Код:
if(playerid == 0) //For Id 0
{
//SetPlayerPos etc...
}
else if(playerid == 1) //For Id 1
{
//setplayerpos etc...
}
else if(playerid == 2) //For Id 2
{
//setplayerpos etc...
}
else if etc...
oh, so the same as classids? xD

This forum requires that you wait 120 seconds between posts. Please try again in 32 seconds.

gay.

ty man!


Re: read! - Vince - 09.09.2010

Use a switch. Far more efficient and also takes less space.
pawn Код:
switch(playerid)
{
    case 0: SetPlayerPos(playerid, x, y, z);
    case 1: SetPlayerPos(playerid, x, y, z);
    case 2: SetPlayerPos(playerid, x, y, z);
    case 3: SetPlayerPos(playerid, x, y, z);
    // etc
}
Don't know why this would be useful, though ...


Re: read! - thomas.. - 09.09.2010

Quote:
Originally Posted by Vince
Посмотреть сообщение
Use a switch. Far more efficient and also takes less space.
pawn Код:
switch(playerid)
{
    case 0: SetPlayerPos(playerid, x, y, z);
    case 1: SetPlayerPos(playerid, x, y, z);
    case 2: SetPlayerPos(playerid, x, y, z);
    case 3: SetPlayerPos(playerid, x, y, z);
    // etc
}
Don't know why this would be useful, though ...
youll find out