Help please.
#1

I wanna make a stat command that sets your stat to 100. It has to work like this:

Must work on SetPlayerScore(giveplayerid,100);
SetPlayerHealth(giveplayerid,100);
SetPlayerMoney(playerid,999999);

/makefull [playerid] [statid]

I have this:
Код:
if(strcmp(cmd,"/makefull", true) == 0)
{

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /makefull [playerid] [stat]");
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_VELROOD,"*This ID is not connected*");
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /makefull [playerid] [stat]");
    new statt = strval(tmp);
    if(adminlevel[playerid] >= 8)
    {
    adminlevel[giveplayerid] = statt;
    }
    else
    {
    SendClientMessage(playerid,COLOR_GRIJS,"You're not allowed to use this command");
    }
    return 1;
	}
but this is not done yet and probaly not good.xD
Please fix and help.

Thanks inr egards
Reply
#2

pawn Код:
if(strcmp(cmd,"/makefull", true) == 0)
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /makefull [playerid] [stat]");
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_VELROOD,"*This ID is not connected*");
    new tmp2[256];
    tmp2 = strtok(cmdtext, idx);
    if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /makefull [playerid] [stat]");
    new statt = strval(tmp2);
    if(adminlevel[playerid] >= 8)
    {
        adminlevel[giveplayerid] = statt;
        SetPlayerScore(giveplayerid,100);
        SetPlayerHealth(giveplayerid,100);
        SetPlayerMoney(playerid,999999);

    }
    else
    {
        SendClientMessage(playerid,COLOR_GRIJS,"You're not allowed to use this command");
    }
    return 1;
}
Reply
#3

Ye I know that :P But I mean that the commmand should work like this:

id 1 =money
id 2 = score
id 3 = health
id 4 = adminlevel

/makefull playerid 3 (that must set is health to 100)
Reply
#4

pawn Код:
if(strval(tmp2) == 1) SetPlayerMoney(giveplayerid,999999);
if(strval(tmp2) == 2) SetPlayerScore(giveplayerid,100);
Etc.
Reply
#5

ok I will test that hiddos ty
Reply
#6

I know have this:
Код:
if(strcmp(cmd,"/makefull", true) == 0)
{

    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /makefull [playerid] [stat]");
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_VELROOD,"*This ID is not connected*");
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /makefull [playerid] [stat]");
    
    if(adminlevel[playerid] >= 3)
    {
    if(strval(tmp2) == 1) SetPlayerScore(giveplayerid,23);
    if(strval(tmp2) == 2) SetPlayerScore(giveplayerid,73);
    if(strval(tmp2) == 3) SetPlayerScore(giveplayerid,89);
    if(strval(tmp2) == 4) SetPlayerScore(giveplayerid,100);
    }
    else
    {
    SendClientMessage(playerid,COLOR_GRIJS,"You're not allowed to use this command");
    }
    return 1;
	}
But when I do /makefull [playerid] [statid] it doesn't set's my score to 23 or 73 etc.

Someone please help
Reply
#7

Ow it works already.
bUt can I also make that I can do /makefull [playerid] [statid] [amount] ?
Reply
#8

Add another amount variable.
Reply
#9

alright I will try.
Reply
#10

Well I have this:
Код:
if(strcmp(cmd,"/spg", true) == 0)
{
    new gangrank = strval(tmp3);
    tmp = strtok(cmdtext, idx);
   if(!strlen(tmp2))return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /spg [playerid] [gang] [rank]");

    
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_VELROOD,"*This ID is not connected*");

    tmp2 = strtok(cmdtext, idx);
    if(!strlen(tmp2))return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /spg [playerid] [gang] [rank]");
   
    tmp3 = strtok(cmdtext, idx);
    if(!strlen(tmp2))return SendClientMessage(playerid, COLOR_GRIJS, "TIP: Type /spg [playerid] [gang] [rank]");


    if(adminlevel[playerid] >= 8)
    {
    sapd[giveplayerid] = gangrank;
    grove[giveplayerid] = gangrank;
	sapd[giveplayerid] = 0;
	grove[giveplayerid] = 0;
    if(strval(tmp2) == 1) sapd[giveplayerid] = 1;
    if(strval(tmp2) == 2) grove[giveplayerid] = 1;
    
    if(strval(tmp2) == 99) grove[giveplayerid] = 0;
    }
    else
    {
        SendClientMessage(playerid,COLOR_GRIJS,"You're not allowed to use this command");
    }
    return 1;
}
It gives 2 errors :P
Код:
C:\Users\Bart\Desktop\Sa-mp\gamemodes\NightLife.pwn(394) : error 017: undefined symbol "tmp3"
C:\Users\Bart\Desktop\Sa-mp\gamemodes\NightLife.pwn(405) : error 017: undefined symbol "tmp3"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
I don't think it is good either
I;m new to these things though
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)