Originally Posted by juice.j
Check the example of this wiki article out:
https://sampwiki.blast.hk/wiki/OnPlayerRequestClass Instead of comparing the admin level in an if-clause you could just compare the player name for instance. |
Originally Posted by Killa_
|
if(classid == 3 && !IsPlayerAdmin(playerid))
new cmpstr[MAX_PLAYER_NAME]; GetPlayerName(playerid, cmpstr, sizeof(cmpstr)); if(classid == 5 && strcmp(cmpstr,"Jay",false)) //classid == 5 as you want to reserve the fifth classid
public OnPlayerRequestClass(playerid,classid) { new cmpstr[MAX_PLAYER_NAME]; GetPlayerName(playerid, cmpstr, sizeof(cmpstr)); if(classid == 5 && strcmp(cmpstr,"Jay",false)) { SendClientMessage(playerid,COLOR_GREEN,"This skin is only for Jay!"); return 0; } return 1; }
Originally Posted by juice.j
Alright,
you can pretty much use the example as it is, however you change this line here: Код:
if(classid == 3 && !IsPlayerAdmin(playerid)) Код:
new cmpstr[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(classid == 5 && strcmp(name,"Jay",false)) //classid == 5 as you want to reserve the fifth classid Код:
public OnPlayerRequestClass(playerid,classid) { new cmpstr[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(classid == 5 && strcmp(name,"Jay",false)) { SendClientMessage(playerid,COLOR_GREEN,"This skin is only for admins!"); return 0; } return 1; } |
public OnPlayerRequestClass(playerid,classid) { new cmpstr[MAX_PLAYER_NAME]; GetPlayerName(playerid, cmpstr, sizeof(cmpstr)); if(classid == 5 && strcmp(cmpstr,"Jay",false)) { SendClientMessage(playerid,COLOR_GREEN,"This skin is only for Jay!"); return 0; } return 1; }
Originally Posted by juice.j
Hang on I pasted it a bit in a rush, there are some errors, use the edited one here:
Код:
public OnPlayerRequestClass(playerid,classid) { new cmpstr[MAX_PLAYER_NAME]; GetPlayerName(playerid, cmpstr, sizeof(cmpstr)); if(classid == 5 && strcmp(cmpstr,"Jay",false)) { SendClientMessage(playerid,COLOR_GREEN,"This skin is only for Jay!"); return 0; } return 1; } |
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); AddPlayerClass(673, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); AddPlayerClass(289, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); AddPlayerClass(92, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);//line 5 this would be locked.?