SA-MP Forums Archive
1 Error !? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 1 Error !? (/showthread.php?tid=268338)



1 Error !? - necrobg3 - 12.07.2011

Hi all. im new in the scripting edition and now im creating my own command /vehrepair.
But i have 1 Error who says:
Quote:

error 008: must be a constant expression; assumed zero. Error 1.

Why i think i make all good but this error...

Here is my command
Quote:

//----------------------------Repair Command----------------------------------------------
if ( !strcmp( cmdtext, "/vehrepair", true ) )
{
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, -1, "Silly boy, you are not in any vehicle." );

if ( gVehDelay[ playerid ] != -1 )
return SendClientMessage( playerid, -1, "Please wait before using the command again! Or pedobear will ate you." );

if ( GetPlayerMoney( playerid ) < 14500 )
return SendClientMessage( playerid, -1, "Not enough money. Kill a pedobear for money!" );

RepairVehicle( GetPlayerVehicleID( playerid ) );

gVehDelay[ playerid ] = 10;

SetTimerEx( "useRepairAgain", 120000, false, "i", playerid );

return 1;
}

in the NEW CMDS i have this code awready :
Quote:

new gVehDelay[ playerid ] = { -1, ... };

Help please. Whats Wrong


Re: 1 Error !? - Gazmull - 12.07.2011

pawn Код:
gVehDelay[ playerid ] = 1;
pawn Код:
public useRepairAgain(playerid)
{
    gVehDelay[ playerid ] = 0;
}



Re: 1 Error !? - necrobg3 - 12.07.2011

Can you just tell me where to put the firts and the second?


Re: 1 Error !? - necrobg3 - 12.07.2011

Please Repeat Slowly xD