take the colour before and after
#1

I want when the player do /stopserviceadmin he take the colour before the /service admin
there is the code :

PHP код:
COMMAND:serviceadmin(playeridparams[])
{
    
SendAdminText(playerid"/serviceadmin"params);
    if (
APlayerData[playerid][LoggedIn] == false) return 0;
    if (
APlayerData[playerid][PlayerLevel] < 1) return 0;
     new 
AdminName[24];
    new 
string[128];
    
GetPlayerName(playeridAdminNamesizeof(AdminName));
    
format(stringsizeof(string),"L'administrateur %s c'est mis en service !"AdminName);
    
SendClientMessageToAll(0xFFFFFFstring);
    
SetPlayerSkin(playerid217);
     
SendClientMessage(playerid,0xFFFFFFFF"Vous etes passez en admin en service !");
    
SetPlayerColor(playerid0xFF0000FF);
    return 
1;
}
COMMAND:stopserviceadmin(playeridparams[])
{
    
SendAdminText(playerid"/stopserviceadmin"params);
    if (
APlayerData[playerid][LoggedIn] == false) return 0;
    if (
APlayerData[playerid][PlayerLevel] < 1) return 0;
    new 
AdminName[24];
    new 
string[128];
    
GetPlayerName(playeridAdminNamesizeof(AdminName));
    
format(stringsizeof(string),"L'administrateur %s c'est mis en hors service admin !"AdminName);
    
SendClientMessageToAll(0xFFFFFFstring);
    
SetPlayerSkin(playerid48);
    
SendClientMessage(playerid,0xFFFFFFFF"Vous etes maintenant en hors service admin !");
    return 
1;

Reply
#2

Add in enum APlayerData -> PlayerColour
in serviceadmin before SetPlayerColor
pawn Код:
APlayerData[playerid][PlayerColour] = GetPlayerColor(playerid);
in stopserviceadmin

pawn Код:
SetPlayerColor(playerid, APlayerData[playerid][PlayerColour]);
Reply
#3

It's make me warning

Код:
C:\Users\mickael\Desktop\Serveur SAMP\gamemodes\PPC.pwn(17948) : warning 213: tag mismatch
C:\Users\mickael\Desktop\Serveur SAMP\gamemodes\PPC.pwn(17965) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
PHP код:
COMMAND:serviceadmin(playeridparams[])
{
    
SendAdminText(playerid"/serviceadmin"params);
    if (
APlayerData[playerid][LoggedIn] == false) return 0;
    if (
APlayerData[playerid][PlayerLevel] < 1) return 0;
     new 
AdminName[24];
    new 
string[128];
    
GetPlayerName(playeridAdminNamesizeof(AdminName));
    
format(stringsizeof(string),"L'administrateur %s c'est mis en service !"AdminName);
    
SendClientMessageToAll(0xFFFFFFstring);
    
SetPlayerSkin(playerid217);
     
SendClientMessage(playerid,0xFFFFFFFF"Vous etes passez en admin en service !");
    
APlayerData[playerid][PlayerColour] = GetPlayerColor(playerid);
    
SetPlayerColor(playerid0xFF0000FF);
    return 
1;
}
COMMAND:stopserviceadmin(playeridparams[])
{
    
SendAdminText(playerid"/stopserviceadmin"params);
    if (
APlayerData[playerid][LoggedIn] == false) return 0;
    if (
APlayerData[playerid][PlayerLevel] < 1) return 0;
    new 
AdminName[24];
    new 
string[128];
    
GetPlayerName(playeridAdminNamesizeof(AdminName));
    
format(stringsizeof(string),"L'administrateur %s c'est mis en hors service admin !"AdminName);
    
SendClientMessageToAll(0xFFFFFFstring);
    
SetPlayerSkin(playerid48);
    
SendClientMessage(playerid,0xFFFFFFFF"Vous etes maintenant en hors service admin !");
    
SetPlayerColor(playeridAPlayerData[playerid][PlayerColour]);
    return 
1;

Reply
#4

On what line?
Reply
#5

PHP код:
COMMAND:serviceadmin(playeridparams[]) 

    
SendAdminText(playerid"/serviceadmin"params); 
    if (
APlayerData[playerid][LoggedIn] == false) return 0
    if (
APlayerData[playerid][PlayerLevel] < 1) return 0
     new 
AdminName[24]; 
    new 
string[128]; 
    
GetPlayerName(playeridAdminNamesizeof(AdminName)); 
    
format(stringsizeof(string),"L'administrateur %s c'est mis en service !"AdminName); 
    
SendClientMessageToAll(0xFFFFFFstring); 
    
SetPlayerSkin(playerid217); 
     
SendClientMessage(playerid,0xFFFFFFFF"Vous etes passez en admin en service !"); 
    
APlayerData[playerid][PlayerColour] = GetPlayerColor(playerid); // this line warning
    
SetPlayerColor(playerid0xFF0000FF); 
    return 
1

COMMAND:stopserviceadmin(playeridparams[]) 

    
SendAdminText(playerid"/stopserviceadmin"params); 
    if (
APlayerData[playerid][LoggedIn] == false) return 0
    if (
APlayerData[playerid][PlayerLevel] < 1) return 0
    new 
AdminName[24]; 
    new 
string[128]; 
    
GetPlayerName(playeridAdminNamesizeof(AdminName)); 
    
format(stringsizeof(string),"L'administrateur %s c'est mis en hors service admin !"AdminName); 
    
SendClientMessageToAll(0xFFFFFFstring); 
    
SetPlayerSkin(playerid48); 
    
SendClientMessage(playerid,0xFFFFFFFF"Vous etes maintenant en hors service admin !"); 
    
SetPlayerColor(playeridAPlayerData[playerid][PlayerColour]); // this line warning
    
return 1

Reply
#6

Show us "PlayerColour" in your enum.
Reply
#7

PHP код:
enum
{
    
PlayerColour

Reply
#8

You should put your PlayerColour where you put PlayerLevel, LoggedIn and etc. - do not leave him alone, plus it should be something like that:

PHP код:
enum PlayerInfo
{
    
PlayerColour

PHP код:
new APlayerData [MAX_PLAYERS][PlayerInfo]; 
Reply
#9

If you're only using PlayerColour, it shouldn't be in an enum.
Reply
#10

Quote:
Originally Posted by luke49
Посмотреть сообщение
You should put your PlayerColour where you put PlayerLevel, LoggedIn and etc. - do not leave him alone
Here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)