Buyspawn
#1

I got this error:

pawn Код:
C:\Users\reha5\Desktop\samp server\gamemodes\quebradosrp2.pwn(524) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Here is the stuff I did. I first made a CMD:

pawn Код:
CMD:buyspawn(playerid,params[]) {
    new Float:x, Float:y, Float:z;
    if (gLogged[playerid])
    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
    dUserSetINT(PlayerName(playerid)).("pos", GetPlayerPos(playerid, Float:x, Float:y, Float:z));
    GivePlayerMoney(playerid, -1000);
    return 1;
}
Then on the login part.

pawn Код:
CMD:login(playerid,params[]) {
    if (gLogged[playerid]) return SystemMsg(playerid,"You have already logined.");
    if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"You do not have an account, please /register [password]");
    if (strlen(params)==0) return SystemMsg(playerid,"USAGE: /login [password]");
    if (udb_CheckLogin(PlayerName(playerid),params)) {
       new Float:x, Float:y, Float:z;
       SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("score"));
       SetPlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money"));
       SetPlayerTeam(playerid,dUserINT(PlayerName(playerid)).("faction"));
       SetPlayerSkin(playerid,dUserINT(PlayerName(playerid)).("Skin"));
       pInfo[playerid][pRank] = dUserINT(PlayerName(playerid)).("rank");
       SetPlayerPos(playerid, Float:x, Float:y, Float:z, dUserINT(PlayerName(playerid)).("pos"));
       SpawnPlayer(playerid);
       gLogged[playerid]=true;
       return SystemMsg(playerid,"You have successfully logined.");
    }
    return SystemMsg(playerid,"Wrong password or nickname!");
}

I just can't figure out what i've done wrong..

sincerely
Facepunch
Reply
#2

SetPlayerPos has only 3 parameters, X Y and Z. You included dUserINT(PlayerName(playerid)).("pos") also, you must remove it in order to get rid of that warning.
Reply
#3

I must include dUserINT in order to load the skin that got bought?

Anyways, I did this:
pawn Код:
new Float:x, Float:y, Float:z;
       SetPlayerPos(Float:x, Float:y, Float:z, dUserINT(PlayerName(playerid)).("pos"));
Now I get a tag mismatch error.
Reply
#4

Well, first of all, "pos" is a Float and not an Int, and second of all, I think it should be like this:

pawn Код:
SetPlayerPos(playerid, dUserINT(PlayerName(playerid)).("posx"), dUserINT(PlayerName(playerid)).("posy"), dUserINT(PlayerName(playerid)).("posz"));
So you should make 3 variables for it instead of just one.

Also the dot "." in SetPlayerPos or any function like it is for the 2nd decimal and not for a function (if you understand what I mean, it's like 1.25, or 25.25).
Reply
#5

Thanks for showing me, and also explaining, but now I have no idea how to do it the reverse way the way you did it, by saving:

pawn Код:
CMD:buyspawn(playerid,params[]) {
    new Float:x, Float:y, Float:z;
    if (gLogged[playerid])
    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
    dUserSetINT(PlayerName(playerid)).("pos", GetPlayerPos(playerid, Float:x, Float:y, Float:z));

    GivePlayerMoney(playerid, -1000);
    return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)