Error with car command
#1

Im trying to make a command so that only one player can use it but I'm getting errors.
PHP код:
    CMD:b(playeridparams[])
    {
    new 
string[128],pName[MAX_PLAYER_NAME];
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playerid,WHITE"USAGE: /b [text] (Local OOC Chat)");
    
GetPlayerName(playeridpNamesizeof(pName)); //This gets the player name...
    
format(stringsizeof(string), "%s: (( %s ))"pNameparams); //This format gets what the player types
    
ProxDetector(30,playeridstring,GREY);
    return 
1;
    }
    
CMD:datguy(playeridparams[])
    {
    
//----------------[Variables for owners name]----------------------------
     
new sendername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
    if(
IsPlayerInAnyVehicle(playerid))
    return 
SendClientMessage(playeridRED"ERROR: You already have a Vehicle");
    }
    if(
strcmp(sendername"Tyler_Hale"false) == 0)
    {
    
SendClientMessage(playerid,RED,"You can not perform this command you are not Tyler Hale")
    }
    if(!
strlen(params))
    {
    
SendClientMessage(playerid,-1"Usage: /datguy")
    return 
SendClientMessage(playerid,ORANGE,"Function: Will create datguy car made for Tyler")
    }
    new 
Float:X,Float:Y,Float:Z,Float:Angle;
    
GetPlayerPos(playerid,X,Y,Z);
    
GetPlayerFacingAngle(playerid,Angle);
    
SetVehicleNumberPlate(CreateVehicle(545,X,Y,Z,Angle,158,158,-1)"DATGUY");
    return 
1;
    } 
It's the datguy command I included the b command just in case that could be causing it.
Here are the errors.
PHP код:
C:\Users\logan_000\Desktop\Samp server\pawno\include\OPSP.inc(63) : warning 219local variable "Angle" shadows a variable at a preceding level
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(499) : warning 209: function "cmd_datguy" should return a value
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(500) : error 010invalid function or declaration
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(504) : error 010invalid function or declaration
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(507) : error 010invalid function or declaration
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(510) : error 021symbol already defined"GetPlayerPos"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(513) : error 010invalid function or declaration
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(713) : warning 203symbol is never used"Angle"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(713) : warning 203symbol is never used"X"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(713) : warning 203symbol is never used"Y"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(713) : warning 203symbol is never used"Z"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(713) : warning 203symbol is never used"gTeam"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

Reply
#2

Try this!
pawn Код:
CMD:datguy(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "ERROR: You already have a Vehicle");
    {
        if(strcmp(sendername, "Tyler_Hale", false) == 0)
        {
            SendClientMessage(playerid,RED,"You can not perform this command you are not Tyler Hale")
        }
        if(!strlen(params))
        {
            SendClientMessage(playerid,-1, "Usage: /datguy")
            return SendClientMessage(playerid,ORANGE,"Function: Will create datguy car made for Tyler")
        }
    }  
    new Float:X,Float:Y,Float:Z,Float:Angle;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    SetVehicleNumberPlate(CreateVehicle(545,X,Y,Z,Angle,158,158,-1)"DATGUY");
    return 1;
}
Reply
#3

That didnt work here are the errors
PHP код:
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(501) : error 001expected token";"but found "}"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(505) : error 001expected token";"but found "return"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(506) : error 001expected token";"but found "}"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(511) : error 001expected token","but found "-string-"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(511) : warning 215expression has no effect
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(511) : error 001expected token";"but found ")"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(511) : error 029invalid expressionassumed zero
C
:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(511) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
7 Errors

Reply
#4

PHP код:
CMD:datguy(playeridparams[])
{
    new 
sendername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridsendernamesizeof(sendername));
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridRED"ERROR: You already have a Vehicle");
    {
        if(
strcmp(sendername"Tyler_Hale"false) == 0)
        {
            
SendClientMessage(playerid,RED,"You can not perform this command you are not Tyler Hale");
        }
        if(!
strlen(params))
        {
            
SendClientMessage(playerid,-1"Usage: /datguy");
            return 
SendClientMessage(playerid,ORANGE,"Function: Will create datguy car made for Tyler");
        }
    }
    new 
Float:X,Float:Y,Float:Z,Float:Angle;
    
GetPlayerPos(playerid,X,Y,Z);
    
GetPlayerFacingAngle(playerid,Angle);
    
SetVehicleNumberPlate(CreateVehicle(545,X,Y,Z,Angle,158,158,-1),"DATGUY");
    return 
1;

Reply
#5

I still have problems I can spawn the car and I'm not Tyler_Hale also the components dont show
PHP код:
CMD:datguy(playeridparams[])
    {
    
//---------------------[Variables to check Tylers name]-------------------
    
new sendername[MAX_PLAYER_NAME];
    new 
datguy;
    
GetPlayerName(playeridsendernamesizeof(sendername));
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridRED"ERROR: You already have a Vehicle");
    {
        if(
strcmp(sendername"Tyler_Hale"false) == 0)
        {
            
SendClientMessage(playerid,RED,"You can not perform this command you are not Tyler Hale");
        }
        if(!
strlen(params))
        {
            
SendClientMessage(playerid,-1"Usage: /datguy");
            return 
SendClientMessage(playerid,ORANGE,"Function: Will create datguy car made for Tyler");
        }
    }
    new 
Float:X,Float:Y,Float:Z,Float:Angle;
    
GetPlayerPos(playerid,X,Y,Z);
    
GetPlayerFacingAngle(playerid,Angle);
    
datguy SetVehicleNumberPlate(CreateVehicle(545,X,Y,Z,Angle,158,158,-1),"DATGUY");
    
AddVehicleComponent(datguy,1010);// nitro
    
AddVehicleComponent(datguy,1076);//wire rims
    
return 1;

Reply
#6

pawn Код:
CMD:datguy(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, RED, "ERROR: You already have a Vehicle");
    if(strcmp(sendername, "Tyler_Hale", false) == 0)
        return SendClientMessage(playerid,RED,"You can not perform this command you are not Tyler Hale");
    if(!strlen(params))
        return SendClientMessage(playerid,-1, "Usage: /datguy");
        return SendClientMessage(playerid,ORANGE,"Function: Will create datguy car made for Tyler");
    new Float:X,Float:Y,Float:Z,Float:Angle;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    SetVehicleNumberPlate(CreateVehicle(545,X,Y,Z,Angle,158,158,-1),"DATGUY");
    return 1;
}
Reply
#7

AlphaPac getting rid of all that didnt help at all
Reply
#8

Can someone help me I just want to make a personal command'
Reply
#9

PHP код:
CMD:datguy(playeridparams[]) 
    { 
    
//----------------[Variables for owners name]---------------------------- 
     
new sendername[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridsendernamesizeof(sendername)); 
     
    if(
IsPlayerInAnyVehicle(playerid)) 
    return 
SendClientMessage(playeridRED"ERROR: You already have a Vehicle"); 
    if(
strcmp(sendername"Tyler_Hale"false) == 0
    { 
    
SendClientMessage(playerid,RED,"You can not perform this command you are not Tyler Hale");
    } 
    if(!
strlen(params)) 
    { 
    
SendClientMessage(playerid,-1"Usage: /datguy");
    
SendClientMessage(playerid,ORANGE,"Function: Will create datguy car made for Tyler");
    } 
    new 
Float:X,Float:Y,Float:Z,Float:Angle
    
GetPlayerPos(playerid,X,Y,Z); 
    
GetPlayerFacingAngle(playerid,Angle); 
    
SetVehicleNumberPlate(CreateVehicle(545,X,Y,Z,Angle,158,158,-1)"DATGUY"); 
    return 
1
    } 
Reply
#10

Denying thats not my code this is
PHP код:
CMD:datguy(playeridparams[]) 
    { 
    
//---------------------[Variables to check Tylers name]------------------- 
    
new sendername[MAX_PLAYER_NAME]; 
    new 
datguy
    
GetPlayerName(playeridsendernamesizeof(sendername)); 
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridRED"ERROR: You already have a Vehicle"); 
    { 
        if(
strcmp(sendername"Tyler_Hale"false) == 0
        { 
            
SendClientMessage(playerid,RED,"You can not perform this command you are not Tyler Hale"); 
        } 
        if(!
strlen(params)) 
        { 
            
SendClientMessage(playerid,-1"Usage: /datguy"); 
            return 
SendClientMessage(playerid,ORANGE,"Function: Will create datguy car made for Tyler"); 
        } 
    } 
    new 
Float:X,Float:Y,Float:Z,Float:Angle
    
GetPlayerPos(playerid,X,Y,Z); 
    
GetPlayerFacingAngle(playerid,Angle); 
    
datguy SetVehicleNumberPlate(CreateVehicle(545,X,Y,Z,Angle,158,158,-1),"DATGUY"); 
    
AddVehicleComponent(datguy,1010);// nitro 
    
AddVehicleComponent(datguy,1076);//wire rims 
    
return 1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)