Help Please
#1

hey guys, im trying to do something witch gives errors, when a player connects, the system checks if he got the tag [LSPD], if he does, he will be set in the Police team... but i get errors

Код:
public OnPlayerConnect(playerid)
{
  new pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pName, sizeof(pName));
  if(GetPlayerName(playerid, pName, sizeof(pName)) == "[LSPD]%s", pName)
  {
  SetPlayerTeam(playerid, 1);
  
  }
	return 1;
}
AND i think this is wrongly scripte, could someone help me please?
Reply
#2

Show error's
Reply
#3

Код:
C:\Documents and Settings\Wouter\Bureaublad\SA-MP Scripting\pawno\NEW-RP.pwn(65) : error 033: array must be indexed (variable "-unknown-")
on the if(getplayername code.
Reply
#4

use strcmp
Reply
#5

wut? explain please...

I cant use a command for this :/
Reply
#6

try this (Will Work) :
Код:
OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
new namecheck[128];
format(namecheck,sizeof(namecheck),"[LSPD]%s",name);
if(strcmp(name, namecheck) == 0)
{
SetPlayerTeam(playerid, 1);
return 1;
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)