Help?!
#1

I have a script, but it isn't quite 'finished' there are a few unfinished things and bugs, I want to add more code to the script, when I compile the code itself it's perfect, no errors, but when I add the code into my script, it says 2 errors?

PHP код:
/*
Simple Vehicle Spawn and Destroy by WarriorEd22
*/
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
"Simple Vehicle Spawn and Destroy by WarriorEd22");
    print(
"--------------------------------------\n");
    return 
1;
}
//Commands / Spawn Vehicles
COMMAND:v(playeridparams[])
{
    
#if USE_ADMIN == true
    
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playeridC_RED"This command will be added to this server soon. For now, try /cmds . ");
    
#endif
    
new Vehicle[50];
    if(!
sscanf(params"s[50]"Vehicle))
    {
        new 
string[128], Float:Pos[4];
        
GetPlayerPos(playeridPos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playeridPos[3]);
        new 
veh GetVehicleModelID(Vehicle);
        if(
veh 400 || veh 611) return SendClientMessage(playeridC_RED"This is not a valid vehicle name! Please try again ");
        if(
IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
        
GetXYInFrontOfPlayer(playeridPos[0], Pos[1], 5);
        new 
PVeh CreateVehicle(vehPos[0], Pos[1], Pos[2], Pos[3]+90, -1, -1, -1);
        
LinkVehicleToInterior(PVehGetPlayerInterior(playerid)); SetVehicleVirtualWorld(PVehGetPlayerVirtualWorld(playerid));
        
format(stringsizeof string"You spawned a %s. ID: %i. "aVehicleNames[veh 400], veh);
          
SendClientMessage(playeridC_GREENstring);
    } else return 
SendClientMessage(playeridC_GREEN"Usage: /v [vehiclename] ");
    return 
1;
}
//Stocks - Do NOT Edit ... Ignore
stock GetVehicleModelID(vehiclename[])
{
    for(new 
0211i++)
    {
        if(
strfind(aVehicleNames[i], vehiclenametrue) != -1)
        return 
400;
    }
    return -
1;
}
stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2Float:distance)
{
    new 
Float:a;
    
GetPlayerPos(playeridx2y2a);
    
GetPlayerFacingAngle(playerida);
    if(
GetPlayerVehicleID(playerid))
    {
        
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    
x2 += (distance floatsin(-adegrees));
    
y2 += (distance floatcos(-adegrees));
}
//Vehicle Destroy
COMMAND:vdestroy(playeridparams[])
{
     new 
testcarGetPlayerVehicleID(playerid);
     
SendClientMessage(playerid0xFFFFFFFF"You have deleted a car!!");
     
DestroyVehicle(testcar);
     return 
1;
}
#endif 
That is the code I am trying to add into my script, how can I do so?

My errors:

PHP код:
This:
[
php]C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(232) : warning 201redefinition of constant/macro (symbol "MAX_ROADBLOCKS")
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(29036) : warning 206redundant testconstant expression is non-zero
C
:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97343) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97381) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97402) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(98450) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(103944) : warning 217loose indentation
C
:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(104089) : warning 217loose indentation
C
:\Users\*\Desktop\New folder (2)\pawno\include\zcmd.inc(63) : error 021symbol already defined"Itter_OnGameModeInit"
C:\Users\*\Desktop\New folder (2)\pawno\include\zcmd.inc(84) : error 021symbol already defined"OnPlayerCommandText"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(28182) : warning 204symbol is assigned a value that is never used"InfoBoardTimer"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(56405) : warning 204symbol is assigned a value that is never used"iSweeper"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

[/PHP]
Reply
#2

What errors ?
Reply
#3

This:

PHP код:
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(232) : warning 201redefinition of constant/macro (symbol "MAX_ROADBLOCKS")
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(29036) : warning 206redundant testconstant expression is non-zero
C
:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97343) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97381) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(97402) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(98450) : warning 203symbol is never used"params"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(103944) : warning 217loose indentation
C
:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(104089) : warning 217loose indentation
C
:\Users\*\Desktop\New folder (2)\pawno\include\zcmd.inc(63) : error 021symbol already defined"Itter_OnGameModeInit"
C:\Users\*\Desktop\New folder (2)\pawno\include\zcmd.inc(84) : error 021symbol already defined"OnPlayerCommandText"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(28182) : warning 204symbol is assigned a value that is never used"InfoBoardTimer"
C:\Users\*\Desktop\New folder (2)\gamemodes\SnS-RP.pwn(56405) : warning 204symbol is assigned a value that is never used"iSweeper"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

Reply
#4

1)Convert the command to the strcmp
2)Delete zcmd.inc from the include
Reply
#5

How can I convert it to strcmp? Sorry, I'm VERY basic with coding.
Reply
#6

Quote:
Originally Posted by radiobizza
Посмотреть сообщение
1)Convert the command to the strcmp
2)Delete zcmd.inc from the include
NOOOO. Just, don't do it.

Why do you suggest him to use a slower and old method isntead of the faster one? ...
Reply
#7

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
NOOOO. Just, don't do it.

Why do you suggest him to use a slower and old method isntead of the faster one? ...
Well, what is the faster one??
Reply
#8

Quote:
Originally Posted by MMOSlot
Посмотреть сообщение
Well, what is the faster one??
ZCMD - https://sampforum.blast.hk/showthread.php?tid=91354
YCMD - https://sampforum.blast.hk/showthread.php?tid=169029
Reply
#9

I don't understand all of that :/, I just want to add
PHP код:
/* 
Simple Vehicle Spawn and Destroy by WarriorEd22 
*/ 

#include <a_samp> 
#include <zcmd> 

#if defined FILTERSCRIPT 

public OnFilterScriptInit() 

    print(
"\n--------------------------------------"); 
    print(
"Simple Vehicle Spawn and Destroy by WarriorEd22"); 
    print(
"--------------------------------------\n"); 
    return 
1


//Commands / Spawn Vehicles 
COMMAND:v(playeridparams[]) 

    
#if USE_ADMIN == true 
    
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playeridC_RED"This command will be added to this server soon. For now, try /cmds . "); 
    
#endif 
    
new Vehicle[50]; 
    if(!
sscanf(params"s[50]"Vehicle)) 
    { 
        new 
string[128], Float:Pos[4]; 
        
GetPlayerPos(playeridPos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playeridPos[3]); 
        new 
veh GetVehicleModelID(Vehicle); 
        if(
veh 400 || veh 611) return SendClientMessage(playeridC_RED"This is not a valid vehicle name! Please try again "); 
        if(
IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); } 
        
GetXYInFrontOfPlayer(playeridPos[0], Pos[1], 5); 
        new 
PVeh CreateVehicle(vehPos[0], Pos[1], Pos[2], Pos[3]+90, -1, -1, -1); 
        
LinkVehicleToInterior(PVehGetPlayerInterior(playerid)); SetVehicleVirtualWorld(PVehGetPlayerVirtualWorld(playerid)); 
        
format(stringsizeof string"You spawned a %s. ID: %i. "aVehicleNames[veh 400], veh); 
          
SendClientMessage(playeridC_GREENstring); 
    } else return 
SendClientMessage(playeridC_GREEN"Usage: /v [vehiclename] "); 
    return 
1


//Stocks - Do NOT Edit ... Ignore 
stock GetVehicleModelID(vehiclename[]) 

    for(new 
0211i++) 
    { 
        if(
strfind(aVehicleNames[i], vehiclenametrue) != -1
        return 
400
    } 
    return -
1


stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2Float:distance

    new 
Float:a

    
GetPlayerPos(playeridx2y2a); 
    
GetPlayerFacingAngle(playerida); 

    if(
GetPlayerVehicleID(playerid)) 
    { 
        
GetVehicleZAngle(GetPlayerVehicleID(playerid), a); 
    } 

    
x2 += (distance floatsin(-adegrees)); 
    
y2 += (distance floatcos(-adegrees)); 


//Vehicle Destroy 
COMMAND:vdestroy(playeridparams[]) 

     new 
testcarGetPlayerVehicleID(playerid); 
     
SendClientMessage(playerid0xFFFFFFFF"You have deleted a car!!"); 
     
DestroyVehicle(testcar); 
     return 
1

#endif 
This to my Script, how do I make additions to my script, it can't be hard?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)