PDA

View Full Version : [HELP!] OnPlayerConnect Check If Player Is Admin!


Veeco
24/11/2012, 02:24 PM
Hey :D
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 :D
Understand? :P
Help!! :D
+1rep to that guy as fix that to me! ;)

ItalianKiller1568
24/11/2012, 02:28 PM
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 $$

RenSoprano
24/11/2012, 02:33 PM
This is will be only for Rcon admins if you have something like enum Pinfo and pAdmin add this

enum pInfo
{
pAdmin
}
new PlayerData[MAX_PLAYERS][pInfo];


public OnPlayerConnect(playerid)
{
if(PlayerData[playerid][pAdmin] < 1))
{
GivePlayerScore(playerid, 9000);
GivePlayerWeapon(playerid, 38, 50000);
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
}
return 1;
}

ItalianKiller1568
24/11/2012, 02:35 PM
This is will be only for Rcon admins if you have something like enum Pinfo and pAdmin add this

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 -.-'

RenSoprano
24/11/2012, 02:37 PM
Where he said that he used PPC_Trucking?

ItalianKiller1568
24/11/2012, 03:03 PM
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

RenSoprano
24/11/2012, 03:19 PM
I Only told that if he has enums he need to use pAmind or pLevel or something else not IsPlayerAdmin i gave him example

iggy1
24/11/2012, 03:22 PM
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.

RenSoprano
24/11/2012, 03:24 PM
Why it checks does the player is admin and the database will be louded

iggy1
24/11/2012, 03:27 PM
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.

RenSoprano
24/11/2012, 03:31 PM
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.

Yea you're absolutly right he is begginer and he can't understood that what we talk about.

Veeco
24/11/2012, 05:28 PM
Haha xD Im beginner i dont undertsand so much here :/ But i use ppc trucking ;)