SA-MP Forums Archive
OnPlayerRequestSpawn just not working :S ??? - 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: OnPlayerRequestSpawn just not working :S ??? (/showthread.php?tid=186029)



OnPlayerRequestSpawn just not working :S ??? - <Weponz> - 27.10.2010

I want players only to be about to spawn it thay have 100+ score for this one class:

Код:
public OnPlayerRequestSpawn(playerid)
{

    if(gTeam[playerid] == CLASS_MERC || GetPlayerScore(playerid) < 100){SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
	}
    return 1;
}
Ive tried so many ways its just not working :S

Any help?


Re: OnPlayerRequestSpawn just not working :S ??? - Hiddos - 27.10.2010

You must return 0 in order to refuse the player to spawn, and return 1 to make him spawn


Re: OnPlayerRequestSpawn just not working :S ??? - (SF)Noobanatior - 27.10.2010

do it under
OnPlayerRequestClass(playerid, classid){


Re: OnPlayerRequestSpawn just not working :S ??? - Kidemo - 27.10.2010

pawn Код:
public OnPlayerRequestSpawn(playerid)
{

    if(gTeam[playerid] == CLASS_MERC || GetPlayerScore(playerid) < 100){SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
    }
    return 1;
    }
    return 0;
}
I just tryed it in my script and it worked ok


Re: OnPlayerRequestSpawn just not working :S ??? - Hiddos - 27.10.2010

Quote:
Originally Posted by [MG]Trotty
Посмотреть сообщение
pawn Код:
public OnPlayerRequestSpawn(playerid)
{

    if(gTeam[playerid] == CLASS_MERC || GetPlayerScore(playerid) < 100){SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
    }
    return 1;
    }
    return 0;
}
I just tryed it in my script and it worked ok
I think it didn't, you had the brackets wrong and the returns at the opposite places

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
  if(gTeam[playerid] == CLASS_MERC && GetPlayerScore(playerid) < 100)
  {
    SendClientMessage(playerid, RED, "[ATT]:You Must Have Atleast 100 Score To Be A Mercenary Class!");
    return 0;
  }
  return 1;
}



Re: OnPlayerRequestSpawn just not working :S ??? - Kidemo - 27.10.2010

hehe sorry i got a error once i added another bit of script to it so you were right

BTW love the Cowly Cow FS of yours