26.02.2010, 04:18
alright im doing this for my RP server but i cant manage how to get it working some things are not defined but i dont know how to define them correctly :/
And it appears this thing
I'm doing it in a LARP edit and it supposed to stash drugs and material inside a vehicle i would like some help badly thanks and its really apreciated
Код:
if(strcmp(cmd, "/stash", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /stash [Mats/Drugs] [amount]"); return 1; } new dmat[256]; dmat = strtok(cmdtext, idx); if(!strlen(dmat)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /stash [Mats/Drugs] [amount*]"); return 1; } new pstate,VID; pstate = GetPlayerState(playerid); VID = GetPlayerVehicleID(playerid); if(IsPlayerInAnyVehicle(playerid)) { if(pstate == 2) { if(strcmp(dmat, "mats", true) == 0) { moneys = strval(tmp); if(PlayerInfo[playerid][pMats] < 1) { SendClientMessage(playerid, COLOR_GRAD1, " You dont have Materials !"); return 1; } if(PlayerInfo[playerid][pMats] < moneys) { SendClientMessage(playerid, COLOR_GRAD1, " You dont have that many Materials !"); return 1; } if(PlayerInfo[playerid][pMats] >= moneys) { PlayerInfo[playerid][pMats] -= moneys; carmats[VID] += moneys; format(string,sizeof(string), " You have stashed %d Materials in the car (CARID:%d)", moneys, VID); SendClientMessage(playerid, COLOR_GREEN, string); } } if(strcmp(dmat, "drugs", true) == 0) { moneys = strval(tmp); if(PlayerInfo[playerid][pDrugs] < 0) { SendClientMessage(playerid, COLOR_GRAD1, " You dont have Drugss !"); return 1; } if(PlayerInfo[playerid][pDrugs] < moneys) { SendClientMessage(playerid, COLOR_GRAD1, " You dont have that many Drugss !"); return 1; } if(PlayerInfo[playerid][pDrugs] >= moneys) { PlayerInfo[playerid][pDrugs] -= moneys; cardrugs[VID] += moneys; format(string,sizeof(string), " You have stashed %d Drugs in the car (CARID:%d)", moneys, VID); SendClientMessage(playerid, COLOR_GREEN, string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not the Driver !"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD1, " You aren't in a Car !"); return 1; } } return 1; } if(strcmp(cmd, "/retrieve", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /retrieve [Mats/Drugs/Check] [amount]"); return 1; } new dmat[256]; new pstate,VID; pstate = GetPlayerState(playerid); VID = GetPlayerVehicleID(playerid); dmat = strtok(cmdtext, idx); if(!strlen(dmat)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /stash [Mats/Drugs/Check] [amount*]"); return 1; } if(IsPlayerInAnyVehicle(playerid)) { if(pstate == 2) { tmp = strtok(cmdtext, idx); if(strcmp(dmat, "mats", true) == 0) { moneys = strval(tmp); if(carmats[VID] < 1) { SendClientMessage(playerid, COLOR_GRAD1, " No Materials Stashed !"); return 1; } if(carmats[VID] < moneys) { SendClientMessage(playerid, COLOR_GRAD1, " The Car doesnt have that many Materials !"); return 1; } if(carmats[VID] >= moneys) { PlayerInfo[playerid][pMats] += moneys; carmats[VID] -= moneys; format(string,sizeof(string), " You have Retrieved %d Materials in the car (CARID:%d)", moneys, VID); SendClientMessage(playerid, COLOR_GREEN, string); } } if(strcmp(dmat, "drugs", true) == 0) { moneys = strval(tmp); if(cardrugs[VID] < 0) { SendClientMessage(playerid, COLOR_GRAD1, " You dont have Drugss !"); return 1; } if(cardrugs[VID] < moneys) { SendClientMessage(playerid, COLOR_GRAD1, " You dont have that many Drugss !"); return 1; } if(cardrugs[VID] >= moneys) { PlayerInfo[playerid][pDrugs] += moneys; cardrugs[VID] -= moneys; format(string,sizeof(string), " You have Retrieved %d Drugs in the car (CARID:%d)", moneys, VID); SendClientMessage(playerid, COLOR_GREEN, string); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not the Driver !"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD1, " You aren't in a Car !"); return 1; } } return 1; }
And it appears this thing
Код:
C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12353) : error 017: undefined symbol "cmd" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12357) : error 017: undefined symbol "tmp" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12357) : error 017: undefined symbol "idx" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12358) : error 017: undefined symbol "tmp" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12364) : error 017: undefined symbol "idx" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12379) : error 017: undefined symbol "moneys" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12379) : error 017: undefined symbol "tmp" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12385) : error 017: undefined symbol "moneys" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12390) : error 017: undefined symbol "moneys" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12392) : error 017: undefined symbol "moneys" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12393) : error 017: undefined symbol "carmats" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12393) : warning 215: expression has no effect C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12393) : error 001: expected token: ";", but found "]" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12393) : error 029: invalid expression, assumed zero C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12393) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 14 Errors.