SA-MP Forums Archive
take the colour before and after - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: take the colour before and after (/showthread.php?tid=607605)



take the colour before and after - Eymeric69 - 21.05.2016

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;




Re: take the colour before and after - Jefff - 22.05.2016

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

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



Re: take the colour before and after - Eymeric69 - 22.05.2016

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;




Re: take the colour before and after - Micko123 - 22.05.2016

On what line?


Re: take the colour before and after - Eymeric69 - 22.05.2016

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




Re: take the colour before and after - Stinged - 22.05.2016

Show us "PlayerColour" in your enum.


Re: take the colour before and after - Eymeric69 - 22.05.2016

PHP код:
enum
{
    
PlayerColour




Re: take the colour before and after - luke49 - 22.05.2016

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]; 



Re: take the colour before and after - Stinged - 22.05.2016

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


Re: take the colour before and after - Jefff - 22.05.2016

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