if(strcmp(cmd, "/dealen", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "[BENUTZUNG:] /dealen [SpielerID/Name] [Anzahl]"); return 1; } new Float:gzx, Float:gzy, Float:gzz; GetPlayerPos(playerid,gzx,gzy,gzz); for(new zone = 0; zone < MAX_ZONES; zone++) { if(gzx >= ZoneLocations[zone][0] && gzx < ZoneLocations[zone][2] && gzy >= ZoneLocations[zone][1] && gzy < ZoneLocations[zone][3]) { if(ZoneInfo[zone][ZoneOwnerID] != PlayerInfo[playerid][pFaction]) // falls der Dealer = GebietBesitzer { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Du bist nicht in deinem Viertel!"); return 1; } } } new playa; new needed; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return 1; } needed = strval(tmp); if(needed < 1 || needed > 10) { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Du kannst hцchstens 10 Gramm verticken"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return 1; } if(needed > PlayerInfo[playerid][pGras]) { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Soviel hast du nicht!"); return 1; } if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if (ProxDetectorS(8.0, playerid, playa)) { /*new Float:gzx, Float:gzy, Float:gzz; GetPlayerPos(playerid,gzx,gzy,gzz); for(new zone = 0; zone < MAX_ZONES; zone++) { if(gzx >= ZoneLocations[zone][0] && gzx < ZoneLocations[zone][2] && gzy >= ZoneLocations[zone][1] && gzy < ZoneLocations[zone][3]) { if(ZoneInfo[zone][ZoneOwnerID] == PlayerInfo[playerid][pFaction]) // falls der Dealer = GebietBesitzer {*/ if(playa != playerid) { format(string, sizeof(string), "[INFO:] Du hast %s %d Gramm Gras vertickt.", GetPlayerNameEx(playa), needed); SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string); format(string, sizeof(string), "[INFO:] %s hat dir %d Gramm Gras.", GetPlayerNameEx(playerid), needed); SendClientMessage(playa, COLOR_LIGHTYELLOW2, string); PlayerInfo[playa][pGras] += needed; PlayerInfo[playerid][pGras] -= needed; PlayerPlayerActionMessage(playerid,playa,15.0,"ьbergibt ein Tьtchen mit Gras an"); } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Du kannst dir selber kein Gras verticken!"); } /* } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Du bist nicht in deinem Viertel!"); } } }*/ } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Diese Spieler ist zu weit entfernt!"); } } } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Ungьltige ID."); } } return 1; }
if(strcmp(cmd, "/dealen", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "[USAGE:] /dealen [PlayerID/Name] [Amount]"); return 1; } new Float:gzx, Float:gzy, Float:gzz; GetPlayerPos(playerid,gzx,gzy,gzz); for(new zone = 0; zone < MAX_ZONES; zone++) { if(gzx >= ZoneLocations[zone][0] && gzx < ZoneLocations[zone][2] && gzy >= ZoneLocations[zone][1] && gzy < ZoneLocations[zone][3]) { if(ZoneInfo[zone][ZoneOwnerID] != PlayerInfo[playerid][pFaction]) // if Dealer != ZoneOwner { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] You are not in your Zone!"); return 1; } } } new playa; new needed; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return 1; } needed = strval(tmp); if(needed < 1 || needed > 10) { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] Max Amount is 10g"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return 1; } if(needed > PlayerInfo[playerid][pGras]) { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] You don't have so much!"); return 1; } if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if (ProxDetectorS(8.0, playerid, playa)) { /*new Float:gzx, Float:gzy, Float:gzz; GetPlayerPos(playerid,gzx,gzy,gzz); for(new zone = 0; zone < MAX_ZONES; zone++) { if(gzx >= ZoneLocations[zone][0] && gzx < ZoneLocations[zone][2] && gzy >= ZoneLocations[zone][1] && gzy < ZoneLocations[zone][3]) { if(ZoneInfo[zone][ZoneOwnerID] == PlayerInfo[playerid][pFaction]) // if Dealer != ZoneOwner {*/ if(playa != playerid) { format(string, sizeof(string), "[INFO:] You have sold %s %d g Weed ", GetPlayerNameEx(playa), needed); SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string); format(string, sizeof(string), "[INFO:] %s has sold you %d g Weed.", GetPlayerNameEx(playerid), needed); SendClientMessage(playa, COLOR_LIGHTYELLOW2, string); PlayerInfo[playa][pGras] += needed; PlayerInfo[playerid][pGras] -= needed; PlayerPlayerActionMessage(playerid,playa,15.0,"give Weed to"); } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] You can't sell Weed to yourself!"); } /* } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] You are not in your own Zone!"); } } }*/ } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] This player isn't near enough!"); } } } else { SendClientMessage(playerid, COLOR_LIGHTRED, "[ERROR:] False ID."); } } return 1; }
Originally Posted by RSX
i didn't understand anything of that german writings....
|
tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return 1; }