Problem in Score Capping
#1

OK, i have this:

} else if(classid == 6) {
GameTextForPlayer(playerid,"~b~POLICE OFFICER",1000,5);
if(GetPlayerScore(playerid) < 500)
SendClientMessage(playerid, 0xFFFFFFFF, "You have to have atleast 500 score to be a police officer!");
SetPlayerHealth(playerid, 0);
} else if(classid == 7 ) {
GameTextForPlayer(playerid,"~r~TRUCKER PP",1000,5);
} else if(classid == {
...

But when i pick the Police Officer class i die, then i spawn again in that class as if i had 500 score.
Reply
#2

use ForceClassSelection to bring you back to class selection.
Reply
#3

Why don't you just restrict them from spawning with OnPlayerRequestSpawn (by returning 0) instead of killing them?
Reply
#4

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Why don't you just restrict them from spawning with OnPlayerRequestSpawn (by returning 0) instead of killing them?
i was going to say that but he ain't that good enough of a scripter.
Reply
#5

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Why don't you just restrict them from spawning with OnPlayerRequestSpawn (by returning 0) instead of killing them?
Because I don't know how to do that. L.O.L.
Reply
#6

I've got this:
} else if(classid == 6) {
GameTextForPlayer(playerid,"~b~POLICE OFFICER",1000,5);
if(GetPlayerScore(playerid) < 500)
SendClientMessage(playerid, 0xFFFFFFFF, "You have to have atleast 500 score to be a police officer!");
ForceClassSelection(playerid);
return 0;

EDIT: It shows the POLICE OFFICER text but not the actual class.
Reply
#7

pawn Код:
// Top of script
new pClass[ MAX_PLAYERS ]; // Adjust accordingly

public OnPlayerRequestSpawn( playerid )
{
   if( pClass[ playerid ] == 6 )
   {
      if( GetPlayerScore( playerid ) < 500 )
      {
         SendClientMessage( playerid, 0xFFFFFFFF, "You have to have at least 500 score to be a police officer!" );
         return 0;
      }
   }
   return 1;
}

public OnPlayerRequestClass( playerid, classid )
{
   pClass[ playerid ] = classid;
   return 1;
}
Reply
#8

public OnPlayerRequestSpawn( playerid )
{
if( pClass[ playerid ] == 6 )
{
if( GetPlayerScore( playerid ) < 500 )
{
SendClientMessage( playerid, 0xFFFFFFFF, "You have to have at least 500 score to be a police officer!" );
return 0;
}
}
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
pClass[ playerid ] = classid;
return 1;
}
SetupPlayerForClassSelection(playerid);

if(classid == 0) {

and i've got new pClass[ MAX_PLAYERS ]; where i've got all my other 'new's.

error 021: symbol already defined: "SetupPlayerForClassSelection"
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(473) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(475) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(477) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(479) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(481) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(483) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(485) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(487) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(489) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(492) : error 010: invalid function or declaration
C:\Users\Nicholas\Desktop\TruckersUnited\gamemodes \TruckersUnited.pwn(727) : warning 203: symbol is never used: "SetupPlayerForClassSelection"

Lines 473 to 492

473 if(classid == 0) {
GameTextForPlayer(playerid,"~b~TRUCKER",1000,5);
} else if(classid == 1) {
GameTextForPlayer(playerid,"~b~TRUCKER",1000,5);
} else if(classid == 2) {
GameTextForPlayer(playerid,"~b~TRUCKER",1000,5);
} else if(classid == 3) {
GameTextForPlayer(playerid,"~b~TRUCKER",1000,5);
} else if(classid == 4) {
GameTextForPlayer(playerid,"~b~TRUCKER",1000,5);
} else if(classid == 5) {
GameTextForPlayer(playerid,"~b~TRUCKER",1000,5);
} else if(classid == 7 ) {
GameTextForPlayer(playerid,"~r~TRUCKER PP",1000,5);
} else if(classid == {
GameTextForPlayer(playerid,"~r~TRUCKER",1000,5);
} else if(classid == 9) {
GameTextForPlayer(playerid,"~r~LV PILOT",1000,5);
}
492 return 1;
Reply
#9

You have messed something up. If you would PM me your script, or post it here, I or someone else will be able to fix it for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)