what's wrong with that code?
#1

what's wrong with that code

Код:
public     OnPlayerSpawn(playerid)
{
       case 0: PlayerInfo[playerid][pJob] == 1
       case 1: PlayerInfo[playerid][pJob] == 2
       case 2: PlayerInfo[playerid][pJob] == 3
       case 3: PlayerInfo[playerid][pJob] == 4
       case 4: PlayerInfo[playerid][pJob] == 5
?
Reply
#2

errors problems ...
Reply
#3

i want to when player spawned to randomly selected job and to kill other guys with other job

and i now want to randomly selected job when he spawned

and errors is:

Код:
D:\Djordje\MYDOCU~1\GTA\GTASER~1\GTA0~1.3BR\GAMEMO~1\FinalDM.pwn(147) : error 014: invalid statement; not in switch
D:\Djordje\MYDOCU~1\GTA\GTASER~1\GTA0~1.3BR\GAMEMO~1\FinalDM.pwn(147) : warning 215: expression has no effect
D:\Djordje\MYDOCU~1\GTA\GTASER~1\GTA0~1.3BR\GAMEMO~1\FinalDM.pwn(147) : error 001: expected token: ";", but found ":"
D:\Djordje\MYDOCU~1\GTA\GTASER~1\GTA0~1.3BR\GAMEMO~1\FinalDM.pwn(147) : error 029: invalid expression, assumed zero
D:\Djordje\MYDOCU~1\GTA\GTASER~1\GTA0~1.3BR\GAMEMO~1\FinalDM.pwn(147) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#4

shouldnt this be on OnPlayerRequestClass ?

Also you need to use an switch then:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0: PlayerInfo[playerid][pJob] = 1;
        case 1: PlayerInfo[playerid][pJob] = 2;
        case 2: PlayerInfo[playerid][pJob] = 3;
        case 3: PlayerInfo[playerid][pJob] = 4;
        case 4: PlayerInfo[playerid][pJob] = 5;
    }
    return 1;
}
Reply
#5

thank you gamer

and you give me example for other code
Reply
#6

You could have also done something like this:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid < 5) PlayerInfo[playerid][pJob] = classid + 1;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)