KCASH problem.
#1

My server uses this cheap type of money called "KCASH" ...
They are like points but they are money at the same time...
This goes at the top of my script.
Код:
new KCASH[MAX_PLAYERS];
And when you spawn .. I want it to give you 15 KCASH .. So i put this under Publicongamemodeinit

Код:
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
Errors i get.
Код:
C:\Documents and Settings\home\Desktop\samp02Xserver.win32\gamemodes\KingsRPG.pwn(71) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Код:
OnPlayerSpawn(playerid)
{
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
return 1;
}
But you can use this too

Код:
OnPlayerSpawn(playerid)
{
   GivePlayerMoney(playerid, 15);
   return 1;
}
Reply
#3

Add this before main() :

Код:
new KCash[MAX_PLAYERS];

stock GivePlayerKCash(playerid, money)
{
KCash[playerid] = KCash[playerid] + money;
return KCash[playerid];
}
Then:
Код:
OnPlayerSpawn(playerid)
{
GivePlayerKCash(playerid, 15);
return 1;
}
Have fun !
Reply
#4

Ty battleman .. But uhhh Alice .. I can't understand that .. Because i don't know how to make that work with my /Kcash cmd that shows how much KCASH you have.
Reply
#5

How do you scripted your /Kcash command ? Isn't it something like this ?

Код:
  if (strcmp("/kcash", cmdtext, true) == 0)
    {
        new string[256];
        format(string, sizeof(string), "KCASH : %d", GetPlayerKCash(playerid));
        SendClientMessage(playerid, COLOR, string);
        return 1;
    }
Reply
#6

No it's

Код:
 if(!strcmp(cmdtext,"/kcash",true))
{
  format(string, sizeof string, "You have %i KCASH in your bag.", KCASH[playerid]);
  SendClientMessage(playerid,COLOR_GREEN,string);
  return 1;
}
Reply
#7

in fact it's the same, just add what i said and it will works with your command.
Reply
#8

Quote:
Originally Posted by Sal_Kings
And when you spawn .. I want it to give you 15 KCASH .. So i put this under Publicongamemodeinit

Код:
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
and instead these unneeded lines, you can use:
KCASH[playerid] += 15;
Reply
#9

Quote:
Originally Posted by player007
Quote:
Originally Posted by Sal_Kings
And when you spawn .. I want it to give you 15 KCASH .. So i put this under Publicongamemodeinit

Код:
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
KCASH[playerid]++;
and instead these unneeded lines, you can use:
KCASH[playerid] += 15;
Ty player! I will use that .. Best one so far
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)