#1

i got skin command + i made 2 classes that are TEAM one GROVE and one BALLAS i spawned as GROVE and i typed /skin 230 my skin got changed but when i died i spawned at default LV position where bare script has but i have set GROVE and BALLAS custom locations whenever i typed /skin command and changed my skin grove to any other server can't recognize my spawn position

code :

PHP код:
public OnPlayerSpawn(playerid)
{
    
TextDrawShowForAll(discord[0]);
    
TextDrawShowForAll(discord[1]);
    
    
SetPlayerHealth(playerid, 100);
    
SetPlayerArmour(playerid, 100);
    
SetPlayerInterior(playerid, 0);
    
TogglePlayerClock(playerid, 0);
    
ResetPlayerWeapons(playerid);
    new 
Skin = GetPlayerSkin(playerid);
    switch(
Skin)
    {
        case 
102,104:
        {
            
SetPlayerTeam(playerid, BALLAS);
            
GivePlayerWeapon(playerid, 24, 200);
            
GivePlayerWeapon(playerid, 25, 200);
            
GivePlayerWeapon(playerid, 28, 200);
            
GivePlayerWeapon(playerid, 34, 200);
            
GivePlayerWeapon(playerid, 30, 200);
            
SetPlayerPos(playerid, -2569.7415, 892.6765, 64.9844);
        }
        case 
106,107:
        {
            
SetPlayerTeam(playerid, GROVE);
            
GivePlayerWeapon(playerid, 24, 200);
            
GivePlayerWeapon(playerid, 25, 200);
            
GivePlayerWeapon(playerid, 32, 200);
            
GivePlayerWeapon(playerid, 34, 200);
            
GivePlayerWeapon(playerid, 31, 200);
            
SetPlayerPos(playerid, -1704.2889, 1018.0909, 17.5859);
        }
    }
    return 
1;
}
public 
OnPlayerRequestClass(playerid, classid)
{
    if(
classid == 0) 
    { 
        
SetPlayerSkin(playerid, 102); 
        
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4); 
        
SetPlayerColor(playerid, COLOR_PURPLE); 
        
gTeam[playerid] = 0;
    } 
    if(
classid == 1) 
    { 
        
SetPlayerSkin(playerid, 104); 
        
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4); 
        
SetPlayerColor(playerid, COLOR_PURPLE); 
        
gTeam[playerid] = 0;
    } 
    if(
classid == 2)  
    { 
        
SetPlayerSkin(playerid, 106); 
        
GameTextForPlayer(playerid, "~g~Grove", 1000, 4); 
        
SetPlayerColor(playerid, COLOR_GREEN); 
        
gTeam[playerid] = 1; 
    } 
    if(
classid == 3)  
    { 
        
SetPlayerSkin(playerid, 107); 
        
GameTextForPlayer(playerid, "~g~Grove", 1000, 4); 
        
SetPlayerColor(playerid, COLOR_GREEN); 
        
gTeam[playerid] = 1;
    }
     
SetupPlayerForClassSelection(playerid);
    return 
1;
} 
skin command code :

PHP код:
CMD:skin(playerid, params[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not allowed to use this command");
    new 
skinnumber, skinid, string[128];
    if(
sscanf(params, "d", skinid)) SendClientMessage(playerid, COLOR_WHITE, "{FF6600}Usage: {FFFFFF}/skin [0-299]");
    else if(
skinid < 0 || skinid > 299) SendClientMessage(playerid, COLOR_RED, "Invalid skin ID, Select skin from {AFAFAF}[0-299]");
    else
    {
        
SetPlayerSkin(playerid, skinid);
           
skinnumber = GetPlayerSkin(playerid);
        
format(string, sizeof(string), "You have changed your skin to {AFAFAF}%d", skinnumber);
        
SendClientMessage(playerid, COLOR_ORANGE, string);
    }
    return 
1;
} 
Reply
#2

Quote:
Originally Posted by Lokii
Посмотреть сообщение
PHP код:
CMD:skin(playerid, params[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not allowed to use this command");
    new 
skinnumber, skinid, string[128];
    if(
sscanf(params, "d", skinid)) SendClientMessage(playerid, COLOR_WHITE, "{FF6600}Usage: {FFFFFF}/skin [0-299]");
    else if(
skinid < 0 || skinid > 299) SendClientMessage(playerid, COLOR_RED, "Invalid skin ID, Select skin from {AFAFAF}[0-299]");
    else
    {
        
SetPlayerSkin(playerid, skinid);
           
skinnumber = GetPlayerSkin(playerid);
        
format(string, sizeof(string), "You have changed your skin to {AFAFAF}%d", skinnumber);
        
SendClientMessage(playerid, COLOR_ORANGE, string);
        switch(
skinid)
        {
            case 
102,104: gTeam[playerid] = 0;
            case 
106,107: gTeam[playerid] = 1;
        }
    }
    return 
1;
} 
Код:
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(44) : warning 217: loose indentation
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(45) : warning 217: loose indentation
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(49) : error 017: undefined symbol "gTeam"
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(49) : error 029: invalid expression, assumed zero
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(49) : warning 215: expression has no effect
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(50) : error 014: invalid statement; not in switch
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(50) : warning 215: expression has no effect
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(50) : warning 215: expression has no effect
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(50) : error 001: expected token: ";", but found ":"
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(50) : error 029: invalid expression, assumed zero
C:\Users\DeStRoY\Downloads\Compressed\My Gamemode\pawno\include\cnr/commands.inc(50) : fatal error 107: too many error messages on one line
Reply
#3

You have to change variables. He gave you an example. Also for this you need to know CNRSF well so I suggest dig a bit before attempting to do this.
Reply
#4

Quote:
Originally Posted by Fratello
Посмотреть сообщение
You have to change variables. He gave you an example. Also for this you need to know CNRSF well so I suggest dig a bit before attempting to do this.
i'm making DM server not CNR

EDIT: don't wanna help? don't comment here
Reply
#5

Quote:
Originally Posted by Lokii
Посмотреть сообщение
Add the include after gTeam

PHP код:
new gTeam[MAX_PLAYERS];
#include <cnd\commands> 
already bro

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <core>
#include <float>
#include <cnr/commands>
#define BALLAS 0
#define GROVE 1
//team
new gTeam[MAX_PLAYERS]; 
Reply
#6

Quote:
Originally Posted by Lokii
Посмотреть сообщение
You did not get what i said
i said INCLUDE commands inc AFTER gTeam

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <core>
#include <float>
#define BALLAS 0
#define GROVE 1
//team
new gTeam[MAX_PLAYERS];
#include <cnr/commands> //here 
worked thanks but little messed up here,

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <core>
#include <float>
#include <cnr/colors>
new gTeam[MAX_PLAYERS];
#include <cnr/commands>
#include <cnr/dialogresponse>
#define TOTAL_TEAM_VEHICLES 10 
#define NO_TEAMID -911 
#define BALLAS 0
#define GROVE 1
//grove base gate
new grovedoor;
new 
bool:door_grove; 
new 
Text3D:grovelabel;
//team vehicles
new BallasCars[TOTAL_TEAM_VEHICLES];  
new 
GroveCars[TOTAL_TEAM_VEHICLES]; 
Reply
#7

PHP код:
public OnPlayerSpawn(playerid) 
{ 
    
TextDrawShowForAll(discord[0]); 
    
TextDrawShowForAll(discord[1]); 
     
    
SetPlayerHealth(playerid, 100); 
    
SetPlayerArmour(playerid, 100); 
    
SetPlayerInterior(playerid, 0); 
    
TogglePlayerClock(playerid, 0); 
    
ResetPlayerWeapons(playerid); 

    if(
gteam[playerid] == 0) 
    {  
        
GivePlayerWeapon(playerid, 24, 200); 
        
GivePlayerWeapon(playerid, 25, 200); 
        
GivePlayerWeapon(playerid, 28, 200); 
        
GivePlayerWeapon(playerid, 34, 200); 
        
GivePlayerWeapon(playerid, 30, 200); 
        
SetPlayerPos(playerid, -2569.7415, 892.6765, 64.9844); 
    } 
    else if(
gteam[playerid] == 1)
    {  
        
GivePlayerWeapon(playerid, 24, 200); 
        
GivePlayerWeapon(playerid, 25, 200); 
        
GivePlayerWeapon(playerid, 32, 200); 
        
GivePlayerWeapon(playerid, 34, 200); 
        
GivePlayerWeapon(playerid, 31, 200); 
        
SetPlayerPos(playerid, -1704.2889, 1018.0909, 17.5859); 
    }  
    return 
1; 
} 

public 
OnPlayerRequestClass(playerid, classid) 
{ 
    if(
classid == 0)  
    {  
        
SetPlayerSkin(playerid, 102);
        
SetPlayerTeam(playerid, BALLAS);    
        
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_PURPLE);  
        
gTeam[playerid] = 0; 
    }  
    if(
classid == 1)  
    {  
        
SetPlayerSkin(playerid, 104); 
        
SetPlayerTeam(playerid, BALLAS);
        
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_PURPLE);  
        
gTeam[playerid] = 0; 
    }  
    if(
classid == 2)   
    {  
        
SetPlayerSkin(playerid, 106);
        
SetPlayerTeam(playerid, GROVE);
        
GameTextForPlayer(playerid, "~g~Grove", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_GREEN);  
        
gTeam[playerid] = 1;  
    }  
    if(
classid == 3)   
    {  
        
SetPlayerSkin(playerid, 107); 
        
SetPlayerTeam(playerid, GROVE);
        
GameTextForPlayer(playerid, "~g~Grove", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_GREEN);  
        
gTeam[playerid] = 1; 
    } 

    
SetupPlayerForClassSelection(playerid); 
    return 
1; 
} 
Reply
#8

Quote:
Originally Posted by frouzen
Посмотреть сообщение
PHP код:
public OnPlayerSpawn(playerid) 
{ 
    
TextDrawShowForAll(discord[0]); 
    
TextDrawShowForAll(discord[1]); 
     
    
SetPlayerHealth(playerid, 100); 
    
SetPlayerArmour(playerid, 100); 
    
SetPlayerInterior(playerid, 0); 
    
TogglePlayerClock(playerid, 0); 
    
ResetPlayerWeapons(playerid); 
    if(
gteam[playerid] == 0) 
    {  
        
GivePlayerWeapon(playerid, 24, 200); 
        
GivePlayerWeapon(playerid, 25, 200); 
        
GivePlayerWeapon(playerid, 28, 200); 
        
GivePlayerWeapon(playerid, 34, 200); 
        
GivePlayerWeapon(playerid, 30, 200); 
        
SetPlayerPos(playerid, -2569.7415, 892.6765, 64.9844); 
    } 
    else if(
gteam[playerid] == 1)
    {  
        
GivePlayerWeapon(playerid, 24, 200); 
        
GivePlayerWeapon(playerid, 25, 200); 
        
GivePlayerWeapon(playerid, 32, 200); 
        
GivePlayerWeapon(playerid, 34, 200); 
        
GivePlayerWeapon(playerid, 31, 200); 
        
SetPlayerPos(playerid, -1704.2889, 1018.0909, 17.5859); 
    }  
    return 
1; 
} 
public 
OnPlayerRequestClass(playerid, classid) 
{ 
    if(
classid == 0)  
    {  
        
SetPlayerSkin(playerid, 102);
        
SetPlayerTeam(playerid, BALLAS);    
        
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_PURPLE);  
        
gTeam[playerid] = 0; 
    }  
    if(
classid == 1)  
    {  
        
SetPlayerSkin(playerid, 104); 
        
SetPlayerTeam(playerid, BALLAS);
        
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_PURPLE);  
        
gTeam[playerid] = 0; 
    }  
    if(
classid == 2)   
    {  
        
SetPlayerSkin(playerid, 106);
        
SetPlayerTeam(playerid, GROVE);
        
GameTextForPlayer(playerid, "~g~Grove", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_GREEN);  
        
gTeam[playerid] = 1;  
    }  
    if(
classid == 3)   
    {  
        
SetPlayerSkin(playerid, 107); 
        
SetPlayerTeam(playerid, GROVE);
        
GameTextForPlayer(playerid, "~g~Grove", 1000, 4);  
        
SetPlayerColor(playerid, COLOR_GREEN);  
        
gTeam[playerid] = 1; 
    } 
    
SetupPlayerForClassSelection(playerid); 
    return 
1; 
} 
huehuehue thanks man working now +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)