01.04.2013, 15:39
I would like my server staff's name the change when the do /sduty but it inst working
pawn Код:
CMD:sduty(playerid, params[])
{
new str[100];
if(pStats[playerid][pStaff] >= 1)
{
if(pStats[playerid][pStaffDuty] == 0)
{
pStats[playerid][pStaffDuty] = 1;
format(str, sizeof(str),"[ADMIN] - %s",pStats[playerid][pStaffName]);
SetPlayerName(playerid,str);
SendClientMessage(playerid, COLOR_LIME, "You're now on duty as a staff member");
}else if(pStats[playerid][pStaffDuty] == 1){
pStats[playerid][pStaffDuty] = 0;
format(str, sizeof(str),"%s",pStats[playerid][pPlayerName]);
SetPlayerName(playerid,str);
SendClientMessage(playerid, COLOR_LIME, "You're now off duty as a staff member");
}
}else{
SendClientMessage(playerid, COLOR_RED, stafflevelerror);
}
return 1;
}
pawn Код:
enum pInfo
{
pPlayerName[MAX_PLAYER_NAME],
pMoney,
Pos_X,
Pos_Y,
Pos_Z,
Rotation,
pLevel,
pStaff,
pStaffName[MAX_PLAYER_NAME],
pStaffDuty
}
new pStats[MAX_PLAYERS][pInfo];
pawn Код:
pStats[playerid][pPlayerName] = strval(result[7]);
pStats[playerid][pStaffName] = strval(result[8]);