20.07.2009, 16:53
My first script is almost done! but I get 3 errors when I try to compile can some1 help plz
The Errors:
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(17 9) : error 055: start of function body without function header
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(18 0) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(18 1) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(56 5) : warning 203: symbol is never used: "dcmd_drag0"
The Code:
The Errors:
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(17 9) : error 055: start of function body without function header
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(18 0) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(18 1) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\samp02Xserver.win32\gamemodes\test1.pwn(56 5) : warning 203: symbol is never used: "dcmd_drag0"
The Code:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) //DRAG RACE--------------------------------------------------------------------- //****************************************************************************** { dcmd(drag,4, cmdtext); return 0; } dcmd_drag (playerid, params[]) //line 137 { new targetid, bet; if (sscanf(params, "ui", targetid,bet)) SendClientMessage(playerid, COLOR_RED, "Usage: /drag <playerid> <bet>"); else if (targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "Player not found"); else if (bet > GetPlayerMoney(playerid)) SendClientMessage(playerid, COLOR_RED, "Insufficient Funds"); else { new str[128]; new name[32]; GetPlayerName(playerid,name,32); format(str,sizeof(str),"%s has challenged you to a 1/4 mile race betting %i$! Do you accept?(/drag0)",name,bet); SendClientMessage(targetid,COLOR_YELLOW,str); SetChallengerValue(playerid); SetChallengerVehValue(playerid); SetStakesValue(playerid); } return 1; } //DRAG ACCEPT------------------------------------------------------------------- {//line 179 dcmd(drag0,5,cmdtext);//line 180 return 0;//line 181 } dcmd_drag0 (playerid, params[]) { #pragma unused params new currentveh; new float:x, float:y, float:z, float:X, float:Y, float:a, float:b, float:c, float:d; currentveh = GetPlayerVehicleID(playerid); GetXYInFrontOfVehicle(challenger,X,Y,400); GetXYLeftOfVehicle(challenger[playerid],a,b,3); GetXYLeftOfVehicle(challenger[playerid],c,d,3); GetVehiclePos(challengerveh,x,y,z); SetPlayerRaceCheckpoint(challenger[playerid],1,X,Y,z,X,Y,z,10); SetPlayerRaceCheckpoint(playerid,1,X,Y,z,X,Y,z,10); SetVehiclePos(challengerveh[playerid],a,b,z); SetVehiclePos(currentveh,c,d,z); }