Problem with savecar
#1

So i have these 4 errors with my savecar cmd

PHP код:
C:\Users\Baki\Desktop\developer\filterscripts\Ultra_Tuned_Car_Saver.pwn(95) : error 029invalid expressionassumed zero
C
:\Users\Baki\Desktop\developer\filterscripts\Ultra_Tuned_Car_Saver.pwn(95) : error 017undefined symbol "cmd_savecar"
C:\Users\Baki\Desktop\developer\filterscripts\Ultra_Tuned_Car_Saver.pwn(95) : error 029invalid expressionassumed zero
C
:\Users\Baki\Desktop\developer\filterscripts\Ultra_Tuned_Car_Saver.pwn(95) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
I did include zcmd so idk why im getting this error

The Command

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
COMMAND:savecar(playeridparams[])
{
    new 
file[256];
    new 
str[256];
    new 
Float:nx,Float:ny,Float:nz,Float:nrot,Modelcomp1comp2comp3comp4comp5comp6comp7comp8comp9;
    new Var[
50];
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(filesizeof(file), "Tuned Cars/%s.sav"pname);
    if(!
dini_Exists(file))
    {
    
dini_Create(file);
    }
    if(!
IsPlayerInAnyVehicle(playerid)){
    
SendClientMessage(playerid,0xFF0000FF,"You're not in a vehicle! Find one to save it!");
    return 
1;}
      if(
IsPlayerInAnyVehicle(playerid)){
    if(
dini_Isset(file,"ID") && dini_Isset(file,"X")  && dini_Isset(file,"Y") && dini_Isset(file,"Z") && dini_Isset(file,"ROT") && dini_Isset(file,"COLOR1") && dini_Isset(file,"COLOR2")){
    
SendClientMessage(playerid,0xFFCC00FF,"You have changed your saved vehicle");}
    
GetPlayerPos(playerid,nx,ny,nz);
     
GetVehicleZAngle(GetPlayerVehicleID(playerid),nrot);
    
Model=GetVehicleModel(GetPlayerVehicleID(playerid));
    
comp1 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SPOILER);
    
comp2 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_HOOD);
    
comp3 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_ROOF);
    
comp4 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SIDESKIRT);
    
comp5 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_EXHAUST);
    
comp6 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_WHEELS);
    
comp7 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_HYDRAULICS);
    
comp8 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_FRONT_BUMPER);
    
comp9 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_REAR_BUMPER);
    
dini_IntSet(file,"ID",Model);
    
format(Var, sizeof(Var),"%0.2f"nx);
    
dini_IntSet(file,"X",strval(Var));
    
format(Var, sizeof(Var),"%0.2f"ny);
    
dini_IntSet(file,"Y",strval(Var));
    
format(Var, sizeof(Var),"%0.2f"nz+0.5);
    
dini_IntSet(file,"Z",strval(Var));
    
format(Var, sizeof(Var),"%0.2f"nrot);
    
dini_IntSet(file,"ROT",strval(Var));
    
dini_IntSet(file,"COLOR1",vc1[GetPlayerVehicleID(playerid)]);
    
dini_IntSet(file,"COLOR2",vc2[GetPlayerVehicleID(playerid)]);
    
dini_IntSet(file,"COMPONENT1",comp1);
    
dini_IntSet(file,"COMPONENT2",comp2);
    
dini_IntSet(file,"COMPONENT3",comp3);
    
dini_IntSet(file,"COMPONENT4",comp4);
    
dini_IntSet(file,"COMPONENT5",comp5);
    
dini_IntSet(file,"COMPONENT6",comp6);
    
dini_IntSet(file,"COMPONENT7",comp7);
    
dini_IntSet(file,"COMPONENT8",comp8);
    
dini_IntSet(file,"COMPONENT9",comp9);
    
dini_IntSet(file,"PAINTJOB",vpj[GetPlayerVehicleID(playerid)]);
    
PlayerVehicle[playerid]=GetPlayerVehicleID(playerid);
    
arendaveh[PlayerVehicle[playerid]] = playerid;
    
isarenda[PlayerVehicle[playerid]] = 1;
    
SendClientMessage(playerid,0x00FF00FF,"You have saved your Personal Vehicle");
    
format(strsizeof(str), "{ffffff}%s {ffcc00}saved personal vehicle {00ff00}/scar"pname), SendClientMessageToAll(0xFFFFFFFFstr);}
    return 
1;

Would be glad to rep you if you helped me.
Reply
#2

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

    new 
file[256]; 
    new 
str[256]; 
    new 
Float:nx,Float:ny,Float:nz,Float:nrot,Modelcomp1comp2comp3comp4comp5comp6comp7comp8comp9
    new Var[
50]; 
    
GetPlayerName(playeridpnamesizeof(pname)); 
    
format(filesizeof(file), "Tuned Cars/%s.sav"pname); 
    if(!
dini_Exists(file)) 
    { 
    
dini_Create(file); 
    } 
    if(!
IsPlayerInAnyVehicle(playerid)){ 
    
SendClientMessage(playerid,0xFF0000FF,"You're not in a vehicle! Find one to save it!"); 
    return 
1;} 
      if(
IsPlayerInAnyVehicle(playerid)){ 
    if(
dini_Isset(file,"ID") && dini_Isset(file,"X")  && dini_Isset(file,"Y") && dini_Isset(file,"Z") && dini_Isset(file,"ROT") && dini_Isset(file,"COLOR1") && dini_Isset(file,"COLOR2")){ 
    
SendClientMessage(playerid,0xFFCC00FF,"You have changed your saved vehicle");} 
    
GetPlayerPos(playerid,nx,ny,nz); 
     
GetVehicleZAngle(GetPlayerVehicleID(playerid),nrot); 
    
Model=GetVehicleModel(GetPlayerVehicleID(playerid)); 
    
comp1 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SPOILER); 
    
comp2 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_HOOD); 
    
comp3 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_ROOF); 
    
comp4 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SIDESKIRT); 
    
comp5 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_EXHAUST); 
    
comp6 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_WHEELS); 
    
comp7 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_HYDRAULICS); 
    
comp8 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_FRONT_BUMPER); 
    
comp9 GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_REAR_BUMPER); 
    
dini_IntSet(file,"ID",Model); 
    
format(Var, sizeof(Var),"%0.2f"nx); 
    
dini_IntSet(file,"X",strval(Var)); 
    
format(Var, sizeof(Var),"%0.2f"ny); 
    
dini_IntSet(file,"Y",strval(Var)); 
    
format(Var, sizeof(Var),"%0.2f"nz+0.5); 
    
dini_IntSet(file,"Z",strval(Var)); 
    
format(Var, sizeof(Var),"%0.2f"nrot); 
    
dini_IntSet(file,"ROT",strval(Var)); 
    
dini_IntSet(file,"COLOR1",vc1[GetPlayerVehicleID(playerid)]); 
    
dini_IntSet(file,"COLOR2",vc2[GetPlayerVehicleID(playerid)]); 
    
dini_IntSet(file,"COMPONENT1",comp1); 
    
dini_IntSet(file,"COMPONENT2",comp2); 
    
dini_IntSet(file,"COMPONENT3",comp3); 
    
dini_IntSet(file,"COMPONENT4",comp4); 
    
dini_IntSet(file,"COMPONENT5",comp5); 
    
dini_IntSet(file,"COMPONENT6",comp6); 
    
dini_IntSet(file,"COMPONENT7",comp7); 
    
dini_IntSet(file,"COMPONENT8",comp8); 
    
dini_IntSet(file,"COMPONENT9",comp9); 
    
dini_IntSet(file,"PAINTJOB",vpj[GetPlayerVehicleID(playerid)]); 
    
PlayerVehicle[playerid]=GetPlayerVehicleID(playerid); 
    
arendaveh[PlayerVehicle[playerid]] = playerid
    
isarenda[PlayerVehicle[playerid]] = 1
    
SendClientMessage(playerid,0x00FF00FF,"You have saved your Personal Vehicle"); 
    
format(strsizeof(str), "{ffffff}%s {ffcc00}saved personal vehicle {00ff00}/scar"pname), SendClientMessageToAll(0xFFFFFFFFstr);} 
    return 
1

Zcmd does not use the public OnPlayerCommandText
Reply
#3

Thanks didnt notice eh...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)