#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(playerid100);
    
SetPlayerArmour(playerid100);
    
SetPlayerInterior(playerid0);
    
TogglePlayerClock(playerid0);
    
ResetPlayerWeapons(playerid);
    new 
Skin GetPlayerSkin(playerid);
    switch(
Skin)
    {
        case 
102,104:
        {
            
SetPlayerTeam(playeridBALLAS);
            
GivePlayerWeapon(playerid24200);
            
GivePlayerWeapon(playerid25200);
            
GivePlayerWeapon(playerid28200);
            
GivePlayerWeapon(playerid34200);
            
GivePlayerWeapon(playerid30200);
            
SetPlayerPos(playerid, -2569.7415892.676564.9844);
        }
        case 
106,107:
        {
            
SetPlayerTeam(playeridGROVE);
            
GivePlayerWeapon(playerid24200);
            
GivePlayerWeapon(playerid25200);
            
GivePlayerWeapon(playerid32200);
            
GivePlayerWeapon(playerid34200);
            
GivePlayerWeapon(playerid31200);
            
SetPlayerPos(playerid, -1704.28891018.090917.5859);
        }
    }
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    if(
classid == 0
    { 
        
SetPlayerSkin(playerid102); 
        
GameTextForPlayer(playerid"~p~Ballas"10004); 
        
SetPlayerColor(playeridCOLOR_PURPLE); 
        
gTeam[playerid] = 0;
    } 
    if(
classid == 1
    { 
        
SetPlayerSkin(playerid104); 
        
GameTextForPlayer(playerid"~p~Ballas"10004); 
        
SetPlayerColor(playeridCOLOR_PURPLE); 
        
gTeam[playerid] = 0;
    } 
    if(
classid == 2)  
    { 
        
SetPlayerSkin(playerid106); 
        
GameTextForPlayer(playerid"~g~Grove"10004); 
        
SetPlayerColor(playeridCOLOR_GREEN); 
        
gTeam[playerid] = 1
    } 
    if(
classid == 3)  
    { 
        
SetPlayerSkin(playerid107); 
        
GameTextForPlayer(playerid"~g~Grove"10004); 
        
SetPlayerColor(playeridCOLOR_GREEN); 
        
gTeam[playerid] = 1;
    }
     
SetupPlayerForClassSelection(playerid);
    return 
1;

skin command code :

PHP код:
CMD:skin(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"You're not allowed to use this command");
    new 
skinnumberskinidstring[128];
    if(
sscanf(params"d"skinid)) SendClientMessage(playeridCOLOR_WHITE"{FF6600}Usage: {FFFFFF}/skin [0-299]");
    else if(
skinid || skinid 299SendClientMessage(playeridCOLOR_RED"Invalid skin ID, Select skin from {AFAFAF}[0-299]");
    else
    {
        
SetPlayerSkin(playeridskinid);
           
skinnumber GetPlayerSkin(playerid);
        
format(stringsizeof(string), "You have changed your skin to {AFAFAF}%d"skinnumber);
        
SendClientMessage(playeridCOLOR_ORANGEstring);
    }
    return 
1;

Reply
#2

Quote:
Originally Posted by Lokii
Посмотреть сообщение
PHP код:
CMD:skin(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"You're not allowed to use this command");
    new 
skinnumberskinidstring[128];
    if(
sscanf(params"d"skinid)) SendClientMessage(playeridCOLOR_WHITE"{FF6600}Usage: {FFFFFF}/skin [0-299]");
    else if(
skinid || skinid 299SendClientMessage(playeridCOLOR_RED"Invalid skin ID, Select skin from {AFAFAF}[0-299]");
    else
    {
        
SetPlayerSkin(playeridskinid);
           
skinnumber GetPlayerSkin(playerid);
        
format(stringsizeof(string), "You have changed your skin to {AFAFAF}%d"skinnumber);
        
SendClientMessage(playeridCOLOR_ORANGEstring);
        switch(
skinid)
        {
            case 
102,104gTeam[playerid] = 0;
            case 
106,107gTeam[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(playerid100); 
    
SetPlayerArmour(playerid100); 
    
SetPlayerInterior(playerid0); 
    
TogglePlayerClock(playerid0); 
    
ResetPlayerWeapons(playerid); 

    if(
gteam[playerid] == 0
    {  
        
GivePlayerWeapon(playerid24200); 
        
GivePlayerWeapon(playerid25200); 
        
GivePlayerWeapon(playerid28200); 
        
GivePlayerWeapon(playerid34200); 
        
GivePlayerWeapon(playerid30200); 
        
SetPlayerPos(playerid, -2569.7415892.676564.9844); 
    } 
    else if(
gteam[playerid] == 1)
    {  
        
GivePlayerWeapon(playerid24200); 
        
GivePlayerWeapon(playerid25200); 
        
GivePlayerWeapon(playerid32200); 
        
GivePlayerWeapon(playerid34200); 
        
GivePlayerWeapon(playerid31200); 
        
SetPlayerPos(playerid, -1704.28891018.090917.5859); 
    }  
    return 
1


public 
OnPlayerRequestClass(playeridclassid

    if(
classid == 0)  
    {  
        
SetPlayerSkin(playerid102);
        
SetPlayerTeam(playeridBALLAS);    
        
GameTextForPlayer(playerid"~p~Ballas"10004);  
        
SetPlayerColor(playeridCOLOR_PURPLE);  
        
gTeam[playerid] = 0
    }  
    if(
classid == 1)  
    {  
        
SetPlayerSkin(playerid104); 
        
SetPlayerTeam(playeridBALLAS);
        
GameTextForPlayer(playerid"~p~Ballas"10004);  
        
SetPlayerColor(playeridCOLOR_PURPLE);  
        
gTeam[playerid] = 0
    }  
    if(
classid == 2)   
    {  
        
SetPlayerSkin(playerid106);
        
SetPlayerTeam(playeridGROVE);
        
GameTextForPlayer(playerid"~g~Grove"10004);  
        
SetPlayerColor(playeridCOLOR_GREEN);  
        
gTeam[playerid] = 1;  
    }  
    if(
classid == 3)   
    {  
        
SetPlayerSkin(playerid107); 
        
SetPlayerTeam(playeridGROVE);
        
GameTextForPlayer(playerid"~g~Grove"10004);  
        
SetPlayerColor(playeridCOLOR_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(playerid100); 
    
SetPlayerArmour(playerid100); 
    
SetPlayerInterior(playerid0); 
    
TogglePlayerClock(playerid0); 
    
ResetPlayerWeapons(playerid); 
    if(
gteam[playerid] == 0
    {  
        
GivePlayerWeapon(playerid24200); 
        
GivePlayerWeapon(playerid25200); 
        
GivePlayerWeapon(playerid28200); 
        
GivePlayerWeapon(playerid34200); 
        
GivePlayerWeapon(playerid30200); 
        
SetPlayerPos(playerid, -2569.7415892.676564.9844); 
    } 
    else if(
gteam[playerid] == 1)
    {  
        
GivePlayerWeapon(playerid24200); 
        
GivePlayerWeapon(playerid25200); 
        
GivePlayerWeapon(playerid32200); 
        
GivePlayerWeapon(playerid34200); 
        
GivePlayerWeapon(playerid31200); 
        
SetPlayerPos(playerid, -1704.28891018.090917.5859); 
    }  
    return 
1

public 
OnPlayerRequestClass(playeridclassid

    if(
classid == 0)  
    {  
        
SetPlayerSkin(playerid102);
        
SetPlayerTeam(playeridBALLAS);    
        
GameTextForPlayer(playerid"~p~Ballas"10004);  
        
SetPlayerColor(playeridCOLOR_PURPLE);  
        
gTeam[playerid] = 0
    }  
    if(
classid == 1)  
    {  
        
SetPlayerSkin(playerid104); 
        
SetPlayerTeam(playeridBALLAS);
        
GameTextForPlayer(playerid"~p~Ballas"10004);  
        
SetPlayerColor(playeridCOLOR_PURPLE);  
        
gTeam[playerid] = 0
    }  
    if(
classid == 2)   
    {  
        
SetPlayerSkin(playerid106);
        
SetPlayerTeam(playeridGROVE);
        
GameTextForPlayer(playerid"~g~Grove"10004);  
        
SetPlayerColor(playeridCOLOR_GREEN);  
        
gTeam[playerid] = 1;  
    }  
    if(
classid == 3)   
    {  
        
SetPlayerSkin(playerid107); 
        
SetPlayerTeam(playeridGROVE);
        
GameTextForPlayer(playerid"~g~Grove"10004);  
        
SetPlayerColor(playeridCOLOR_GREEN);  
        
gTeam[playerid] = 1
    } 
    
SetupPlayerForClassSelection(playerid); 
    return 
1

huehuehue thanks man working now +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)