28.08.2014, 20:07
I just wrote up these commands for /setvw and /setint, but they're not working. It doesn't make sense to me, as I'm pretty confident I did it right, so here's those commands:
And the errors:
And then the odd part about my /goto and /gethere commands are that they work 100 percent, and in fact used to work entirely, but for some reason now whenever they're used it just teleports you to some random point(often times that bugged farm in blueberry). Is there anything visibly wrong with these commands, or could it be something else? I'd appreciate any help you can give me. Here's those cmds:
Код:
CMD:setint(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new IntID, targetid, sendername, string[128]; if(sscanf(params, "ui", targetid, IntID)) return SendClientMessage(playerid, -1, "Usage: /setint [player/partofname] [interior ID]"); SetPlayerInterior(playerid, IntID); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Your interior has been set to %i by Admin %s!",IntID,sendername); SendClientMessage(targetid, -1, string); GetPlayerName(targetid, sendername, sizeof(sendername)); format(string, sizeof(string), "You have set %s's interior to %i!",sendername,IntID); SendClientMessage(playerid, -1, string); return 1 ; } return 1; } CMD:setvw(playerid,params[]) { new vw, sendername, string, id; if(PlayerInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid, -1, "You are not a high enough leveled administrator to use this command!"); } else { if(sscanf(params, "ui", id, vw)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /setvw [playerid] [virtualworld]"); if(vw > 2000) return SendClientMessage(playerid, COLOR_WHITE, "Must not exceed 2000"); else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player not found."); SetPlayerVirtualWorld(id,vw); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Your virtual world has been set to %i by Admin %s!",IntID,sendername); SendClientMessage(id, -1, string); GetPlayerName(id, sendername, sizeof(sendername)); format(string, sizeof(string), "You have set %s's virtual world to %i!",sendername,IntID); SendClientMessage(playerid, -1, string); return 1; } return 1; }
PHP код:
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2637) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2637) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2640) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2640) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2661) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2661) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2662) : error 035: argument type mismatch (argument 1)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2662) : error 035: argument type mismatch (argument 1)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2663) : error 035: argument type mismatch (argument 3)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2664) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2664) : error 035: argument type mismatch (argument 2)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2665) : error 035: argument type mismatch (argument 1)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2665) : error 035: argument type mismatch (argument 1)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2666) : error 035: argument type mismatch (argument 3)
C:\Users\Nolan\Desktop\Pawn Scripting\gamemodes\Roleplayscript.pwn(2650) : warning 203: symbol is never used: "string"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
14 Errors.
Код:
CMD:gethere(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new targetid, naot[128], sendername[MAX_PLAYER_NAME]; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/gethere [playerid/partofname]"); new Float:Tpos[3]; if(PlayerInfo[targetid][pAdmin] >= PlayerInfo[playerid][pAdmin]) { SendClientMessage(playerid, -1, "You cannot teleport an admin of equal or greater rank!"); return 1; } else { if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player is not online!"); GetPlayerPos(playerid, Tpos[0], Tpos[1], Tpos[2]); SetPlayerPos(targetid, Tpos[0+2], Tpos[1], Tpos[2]); GetPlayerName(playerid, sendername, sizeof(sendername)); format(naot, sizeof(naot), "You have been teleported by admin *%s!", sendername); SendClientMessage(targetid, -1, naot); GetPlayerName(targetid, sendername, sizeof(sendername)); format(naot, sizeof(naot), "You have teleported *%s to you.", sendername); SendClientMessage(playerid, -1, naot); } return 1; } return 1; } CMD:goto(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new targetid, naot[128], sendername[MAX_PLAYER_NAME]; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/goto [playerid/partofname]"); new Float:Gpos[3]; if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player is not online!"); GetPlayerPos(targetid, Gpos[0], Gpos[1], Gpos[2]); SetPlayerPos(playerid, Gpos[0+1], Gpos[1+1], Gpos[2]); GetPlayerName(playerid, sendername, sizeof(sendername)); format(naot, sizeof(naot), "Admin *%s has teleported to you!", sendername); SendClientMessage(targetid, -1, naot); GetPlayerName(targetid, sendername, sizeof(sendername)); format(naot, sizeof(naot), "You have teleported to *%s.", sendername); SendClientMessage(playerid, -1, naot); } return 1; }