if( strcmp( \"/givecash\", cmdtext, true ) == 0 ){new giveplayerid, moneys;tmp = strtok(cmdtext,idx);if(!strlen(tmp)){SendClientMessage(playerid,0xFF0000AA,\"Használat: /givecash [iD][Pénz]\");}else if (giveplayerid == INVALID_PLAYER_ID){SendClientMessage(playerid, 0xad1010AA, \"Hiba: Nincs ilyen játékos!\");}else{if(giveplayerid == playerid)return SendClientMessage(playerid, 0x06b28cAA, \"Magadnak nem-nem!!!\");new playermoney = GetPlayerMoney(playerid);new playername[MAX_PLAYER_NAME];if (moneys > 0 && playermoney >= moneys){GivePlayerMoney(playerid, (0 - moneys));GivePlayerMoney(giveplayerid, moneys);GetPlayerName(giveplayerid, playername, sizeof (playername));format(string, sizeof(string), \"Te küldtél %s nevû játékosnak pénzt. Összeg %d $ .\", playername, moneys);SendClientMessage(playerid, 0x06b28cAA, string);GetPlayerName(playerid, playername, sizeof (playername));format(string, sizeof(string), \"%s nevû játékostól pénzt kaptál! Összeg %d $ .\", playername, moneys);SendClientMessage(giveplayerid, 0x06b28cAA, string);}else{SendClientMessage(playerid, 0xad1010AA, \"Hiba: Rossz összeg!\");}}return 1;}
if( strcmp( \"/pm\", cmdtext, true ) == 0 ){tmp = strtok(cmdtext,idx);new id,mess[200];if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000AA,\"Használat: /pm [iD][Üzenet]\");else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, \"Hiba: Nincs ilyen játékos!\");else{if(id == playerid) return SendClientMessage(playerid, red, \"Hiba: Magadnak nem küldhetsz üzenetet!\");new name[MAX_PLAYER_NAME];GetPlayerName(playerid, name, sizeof(name));format(string, sizeof string, \"PM: %s[iD:%d]: %s\", name, playerid, mess);SendClientMessage(id,COLOR_RED,string);SendClientMessage(playerid,COLOR_RED,string);}return 1;}
dcmd_nat(playerid,params[]) {if(dmid[playerid] != -1) return SendClientMessage(playerid,COLOR_GREEN,\"DM zónában vagy elõször lépj ki /exitdm\");new string[256];new playermoney;new sendername[MAX_PLAYER_NAME];new giveplayer[MAX_PLAYER_NAME];new giveplayerid, moneys, idx; new tmp[256];tmp = strtok(params, idx);if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, \"HASZNÁLAT: /givecash [iD] [összeg]\");giveplayerid = strval(tmp);tmp = strtok(params, idx);if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, \"HASZNÁLAT: /givecash [iD] [összeg]\"); moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); playermoney = GetPlayerMoney(playerid); if (moneys > 0 && playermoney >= moneys) { GivePlayerMoney(playerid, (0 - moneys)); GivePlayerMoney(giveplayerid, moneys); format(string, sizeof(string), \"Küldtél %s(ID: %d), $%d.\", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, yellow, string); format(string, sizeof(string), \"Kaptál $%d tõle: %s(ID: %d).\", moneys, sendername, playerid); SendClientMessage(giveplayerid, yellow, string); printf(\"%s(ID:%d) Küldött %d neki %s(ID:%d)\",sendername, playerid, moneys, giveplayer, giveplayerid); } else return SendClientMessage(playerid, yellow, \"Hibás tranzakció.\"); } else { format(string, sizeof(string), \"%d nem létezõ játékos.\", giveplayerid); SendClientMessage(playerid, yellow, string); } return 1;}
Szép Copy Flash..Minek az STRCMP, és minek az STRTOK?ZCMD és SSCANF
if( strcmp( \"/pm\", cmdtext, true ) == 0 ){new id;new mess[200];id = strlen(tmp);mess = strlen(tmp2);tmp = strtok(cmdtext, idx);if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, red, \"Használat: /pm [playerid] [szöveg]\");else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, \"Hiba: Nincs ilyen játékos!\");else{if(id == playerid) return SendClientMessage(playerid, red, \"Hiba: Magadnak nem küldhetsz üzenetet!\");new name[MAX_PLAYER_NAME];GetPlayerName(playerid, name, sizeof(name));format(string, sizeof string, \"PM: %s[iD:%d]: %s\", name, playerid, mess); SendClientMessage(id,COLOR_RED,string); SendClientMessage(playerid,COLOR_RED,string);}return 1;}
D:\\gta server\\samp03csvr_win32\\samp03csvr_win32\\gamemodes\\AirWaves.pwn(13663) : error 017: undefined symbol \"tmp2\"D:\\gta server\\samp03csvr_win32\\samp03csvr_win32\\gamemodes\\AirWaves.pwn(13663) : error 033: array must be indexed (variable \"mess\")D:\\gta server\\samp03csvr_win32\\samp03csvr_win32\\gamemodes\\AirWaves.pwn(13665) : error 017: undefined symbol \"tmp2\"Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 3 Errors.