GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: herban - 2011. augusztus 08. - 10:49:00

Cím: Parancs probléma
Írta: herban - 2011. augusztus 08. - 10:49:00
Üdv.
Valamiért nem akar mükõdni ez a max score beállító parancs, mert mindig 0-át ír és nem azt amit én beirok
[pawn]   if(strcmp(cmd, \"/maxkill\", true) == 0)
{
   new idx;
         new tmp[256],amount;
   tmp = strtok(cmdtext, idx);
   if(!strlen(tmp)) return SendClientMessage(playerid, red, \"USAGE: /setallcash [amount]\");
   amount = strval(tmp);
   tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, red, \"/maxkill [Amount]\");
if((amount > 1000) ){
SendClientMessage(playerid,red,\"ERROR: Incorrect Score\");  }
MAXKILLS = amount;
format(string, sizeof(string), \"Maxkill be lett állítva %d-re\", amount);
SendClientMessageToAllEx(COLOR_YELLOW, string);
return 1;
}[/pawn]
Cím: Parancs probléma
Írta: kadaradam - 2011. augusztus 08. - 10:59:06
sscanf-t használsz,csak mert avval egyszerûbb lenne?!
de itt mit szeretnél beállítani? a score-t(SetPlayerScore)?
Cím: Parancs probléma
Írta: herban - 2011. augusztus 08. - 11:16:01
Nem, ez egy war mode és a max kill-t
sscanf-al meglehet ilyet csinálni ?
Cím: Parancs probléma
Írta: kurta999 - 2011. augusztus 08. - 11:36:13
Legegyszerûbb megoldás:
[pawn]
CMD:maxkill(playerid, params[])
{
MAXKILLS = strval(params);
}
[/pawn]
Cím: Parancs probléma
Írta: herban - 2011. augusztus 08. - 12:21:36
Úgy csináltam ahogy mondtad de semmi rossz az egész
Cím: Parancs probléma
Írta: Zsolesszka - 2011. augusztus 08. - 13:10:23
:D
Remélem az a MAXKILLS nem így néz ki:
[pawn]
#define MAXKILLS
[/pawn]
 mert akkor sokkot is kapok.  8)
Ha igen, akkor írd erre:
[pawn]
new MAXKILLS;
[/pawn]
Cím: Parancs probléma
Írta: herban - 2011. augusztus 08. - 14:11:40
A max kill txt fájl-ba van definiálva külön.
Cím: Parancs probléma
Írta: Zsolesszka - 2011. augusztus 08. - 20:28:40
Idézetet írta: herban date=1312805500\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"10268\" data-ipsquote-contentclass=\"forums_Topic
A max kill txt fájl-ba van definiálva külön.
 
what?
És az hogy néz ki?