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; }
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.
new tmp[128], moneys, carmats
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
new cmd[256]; new tmp[256]; new giveplayerid, moneys, idx; new idcar = GetPlayerVehicleID(playerid); new pveh = GetVehicleModel(GetPlayerVehicleID(playerid)); cmd = strtok(cmdtext, idx);
C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : error 028: invalid subscript (not an array or too many subscripts): "carmats" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : warning 215: expression has no effect C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : error 001: expected token: ";", but found "]" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : error 029: invalid expression, assumed zero C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
carmats[VID] += moneys;
Originally Posted by Platanito
Alright added it but i get many errors in 1 line
Код:
C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : error 028: invalid subscript (not an array or too many subscripts): "carmats" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : warning 215: expression has no effect C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : error 001: expected token: ";", but found "]" C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : error 029: invalid expression, assumed zero C:\Users\Vegueta\Downloads\GTARP\gamemodes\gtarp.pwn(12396) : fatal error 107: too many error messages on one line Код:
carmats[VID] += moneys; |
new carmats[MAX_PLAYERS];