18.02.2013, 18:49
Код:
if(strcmp(cmd, "/givedrugs", true) == 0) { if(IsPlayerConnected(playerid)) { new tmp[80]; tmp = strtok(cmdtext, idx); giveplayerid = SQLdenBul(strval(tmp)); if(!strlen(tmp)) { KullanimMesajiGonder(playerid, "/givedrugs [SQL ID] [Strval]"); return 1; } new girilendeger[50]; girilendeger = strtok(cmdtext, idx); new fiyat = strval(tmp2); if(!strlen(girilendeger)) { KullanimMesajiGonder(playerid, "/uyusturucuver [SQL ID] [Miktar]"); return 1; } if (!IsPlayerConnected(giveplayerid)) { HataMesajiGonder(playerid,"kişi oyunda değil."); return 1; } if(giveplayerid == INVALID_PLAYER_ID) { HataMesajiGonder(playerid,"geзersiz id girdin"); return 1; } if (!ProxDetectorS(5.0, playerid, giveplayerid)) { HataMesajiGonder(playerid, "Uyuşturucu vereceğiniz kişiye yakın olmalısınız."); return 1; } if(giveplayerid == playerid) { HataMesajiGonder(playerid,"kendine uyusturucu veremezsin."); return 1; } if(girilendeger > PlayerInfo[playerid][pDrugs]) { HataMesajiGonder(playerid,"o kadar uyusturucun yok."); return 1; } PlayerInfo[giveplayerid][pDrugs] += girilendeger; PlayerInfo[playerid][pDrugs] -= girilendeger; SendClientMessage(playerid,-1,"uyusturucu verdin."); SendClientMessage(giveplayerid,-1,"uyusturucu aldın."); return 1; } }
Код:
C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16337) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16338) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16346) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16347) : error 017: undefined symbol "tmp2" C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16373) : error 033: array must be indexed (variable "girilendeger") C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16378) : error 033: array must be indexed (variable "girilendeger") C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16379) : error 033: array must be indexed (variable "girilendeger") C:\Documents and Settings\Alper\Desktop\Akınayv2\gamemodes\v7.pwn(16347) : warning 204: symbol is assigned a value that is never used: "fiyat"
pawn Код:
16337. new tmp[50];
16338. tmp = strtok(cmdtext, idx);
16346. girilendeger = strtok(cmdtext, idx);
16347. new fiyat = strval(tmp2);
16373. if(girilendeger > PlayerInfo[playerid][pDrugs])
16378. PlayerInfo[giveplayerid][pDrugs] += girilendeger;
16379. PlayerInfo[playerid][pDrugs] -= girilendeger;
16347. new fiyat = strval(tmp2);