[HELP!] OnPlayerConnect Check If Player Is Admin!
#1

Hey
When i connect to my server i want the server to check if the people is admin and then give like 9000 score and some weapons and set that health so they dont dead and more
Understand? :P
Help!!
+1rep to that guy as fix that to me!
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
      if(IsPlayerAdmin))
      {
            GivePlayerScore(playerid, 9000);
            GivePlayerWeapon(playerid, 38, 50000);
            SetPlayerHealth(playerid, 100000);
            SetPlayerArmour(playerid, 100000);
       }
       return 1;
}
EDIT : You don't know to do this and then you script for money ? Watch your signature :
Код:
Scripting And Mapping For $$
Reply
#3

This is will be only for Rcon admins if you have something like enum Pinfo and pAdmin add this

pawn Код:
enum pInfo
{
      pAdmin
}
new PlayerData[MAX_PLAYERS][pInfo];
pawn Код:
public OnPlayerConnect(playerid)
{
      if(PlayerData[playerid][pAdmin] < 1))
      {
            GivePlayerScore(playerid, 9000);
            GivePlayerWeapon(playerid, 38, 50000);
            SetPlayerHealth(playerid, 100000);
            SetPlayerArmour(playerid, 100000);
       }
       return 1;
}
Reply
#4

Quote:
Originally Posted by RenSoprano
Посмотреть сообщение
This is will be only for Rcon admins if you have something like enum Pinfo and pAdmin add this

pawn Код:
public OnPlayerConnect(playerid)
{
      if(PlayerData[playerid][pAdmin] < 1))
      {
            GivePlayerScore(playerid, 9000);
            GivePlayerWeapon(playerid, 38, 50000);
            SetPlayerHealth(playerid, 100000);
            SetPlayerArmour(playerid, 100000);
       }
       return 1;
}
Good copy from PPC_Trucking files , but this wont work , because he will have to define pAdmin and for this will be required PPC_Trucking script files , includes etc -.-'
Reply
#5

Where he said that he used PPC_Trucking?
Reply
#6

Quote:
Originally Posted by RenSoprano
Посмотреть сообщение
Where he said that he used PPC_Trucking?
The code you got is from PPC . The code that i gave is used for everything . But the one you got has the "pAdmin" witch is used in PPC GM and if you use it on another GM , you sure will get error about Unknown Symbol/Function
Reply
#7

I Only told that if he has enums he need to use pAmind or pLevel or something else not IsPlayerAdmin i gave him example
Reply
#8

None of the code that has been posted in this thread will work (may compile but wont work in-game). Your forgetting the mode doesn't know if the player is admin, until he has logged in and has his/her user file loaded.
Reply
#9

Why it checks does the player is admin and the database will be louded
Reply
#10

Quote:
Originally Posted by RenSoprano
Посмотреть сообщение
Why it checks does the player is admin and the database will be louded
Because no-one in this thread has even mentioned saving data. So the poster will think that your code should work. And it clearly won't. Your better off telling him to learn to save data than posting code that wont work.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)