ID 0 to ID 1 and above
#1

Script works but the problem is that If I'm the first one who connects to the server actually my ID is 0 or (ID:0)
then if someone join a player (ID:1) then I do /rep 1 it always say " You can't give yourself a reputation"

But when a Player 1 do /rep 0 It works! I received the rep.

What could be the problem??

pawn Код:
COMMAND:rep(playerid,params[])
{
    new repID, targetid, repName[MAX_PLAYER_NAME],name[24],str[128],str1[128];
    if(reptimer[playerid] > 0)
    {
        SendClientMessage(playerid, WHITE,"{FF0000}Please wait before using it again");
        return 1;
    }
    if(sscanf(params,"u",targetid))
    {
        SendClientMessage(playerid, WHITE,"{FFFF00}Usage: /rep [PlayerID]");
        return 1;
    }
    if(!IsPlayerConnected(targetid))
    {
        SendClientMessage(playerid, WHITE,"{FF0000}>>Player is not online");
        return 1;
    }
    if(repID == playerid)
    {
        SendClientMessage(playerid, WHITE,"{FF0000}>> You can't give yourself a reputation");
        return 1;
    }
    PlayerInfo[targetid][Reps]++;
    GetPlayerName(playerid,name,24);
    GetPlayerName(repID,repName,sizeof(repName));
    format(str,sizeof(str),"%s(%d) has gave +1 reputation point to you",name,playerid);
    SendClientMessage(targetid, GREEN,str);
    format(str1,sizeof(str1),"You have gave %s(%d) +1 reputation point",repName,repID);
    SendClientMessage(playerid, GREEN,str1);
    reptimer[playerid] = SetTimerEx("reptimer1",1200000,true,"i",playerid);
    return 1;
}
Reply


Messages In This Thread
ID 0 to ID 1 and above - by kbalor - 19.09.2012, 18:21
Re: ID 0 to ID 1 and above - by RedJohn - 19.09.2012, 18:25
Re: ID 0 to ID 1 and above - by kbalor - 19.09.2012, 18:43
Re: ID 0 to ID 1 and above - by RedJohn - 19.09.2012, 18:44

Forum Jump:


Users browsing this thread: 1 Guest(s)