PDA

View Full Version : Show Players Rank Once They Join Server (ZCMD)


Eminem 2ka9
05/08/2012, 11:22 AM
I'm using a filterscript known as ZCMD, I added this code to the onplayerspawn and it doesn't seem to be working when the player spawns nothing at all appears, yet the script compiles successfully.

public OnPlayerSpawn(playerid)
{

CallRemoteFunction("GetPlayerRankInfo", "d", playerid);

GivePlayerWeapon(playerid,27,1000);
GivePlayerWeapon(playerid,25,1000);
GivePlayerWeapon(playerid,28,1000);
GivePlayerWeapon(playerid,34,500);
GivePlayerWeapon(playerid,24,500);

}

I basically want it to show the persons rank when he/she spawns.


This is the code that should work:

strcat(tmp, rank);
SendClientMessage(playerid, COLOR_WHITE, tmp);
format(string, sizeof(string),"Name:%s - Your Current Score: "#COL_GREEN#"%d]",Pname, score);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;

Cxnnor
05/08/2012, 11:27 AM
Try:
public OnPlayerSpawn(playerid)
{
GetPlayerRankInfo(playerid);
format(string, sizeof(string), "%s has joined the server, his rank is %d.", PlayerName, PlayerRank);
SendClientMessageToAll(COLOR_GREY, string);
GivePlayerWeapon(playerid,27,1000);
GivePlayerWeapon(playerid,25,1000);
GivePlayerWeapon(playerid,28,1000);
GivePlayerWeapon(playerid,34,500);
GivePlayerWeapon(playerid,24,500);
return 1;
}

Make sure you have stored variables defining it.

Regards, Connor.

Eminem 2ka9
05/08/2012, 11:32 AM
I got some errors doing that!

C:\Users\Administration\Desktop\My Script\gamemodes\MyScript.pwn(1391) : error 017: undefined symbol "GetPlayerRankInfo"
C:\Users\Administration\Desktop\My Script\gamemodes\MyScript.pwn(1392) : error 017: undefined symbol "string"
C:\Users\Administration\Desktop\My Script\gamemodes\MyScript.pwn(1392) : error 017: undefined symbol "string"
C:\Users\Administration\Desktop\My Script\gamemodes\MyScript.pwn(1392) : error 029: invalid expression, assumed zero
C:\Users\Administration\Desktop\My Script\gamemodes\MyScript.pwn(1392) : fatal error 107: too many error messages on one line

By the way I'm trying to get this from my filterscript and I need to know how to do it from my gamemode.

Cxnnor
05/08/2012, 11:37 AM
public OnPlayerSpawn(playerid)
{
new string[128]
format(string, sizeof(string), "%s has joined the server, his rank is %d.", PlayerName, PlayerRank);
SendClientMessageToAll(COLOR_GREY, string);
GivePlayerWeapon(playerid,27,1000);
GivePlayerWeapon(playerid,25,1000);
GivePlayerWeapon(playerid,28,1000);
GivePlayerWeapon(playerid,34,500);
GivePlayerWeapon(playerid,24,500);
return 1;
}

Misiur
05/08/2012, 11:40 AM
Remote function works only if there is remote function. You had it in FS (as of last thread). Now you don't have it at all - you must either port the function to gamemode, or I don't know.

Eminem 2ka9
05/08/2012, 11:44 AM
k thanks anyway