#1

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?

Reply
#2

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...
Reply
#3

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!
Reply
#4

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 ...
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)