if(pName[playerid] == hOwner[hid]) {
error 033: array must be indexed (variable "pName") |
if(strcmp(hOwner[hid], pName[playerid], true)) {
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); if(pname[playerid] == hOwner[hid]) { SendClientMessage(playerid,COLOR_,"OHAI"); }
//These Are Up Top
new pName[MAX_PLAYERS][MAX_PLAYER_NAME];
new hOwner[MAX_HOUSES];
//These Are Used In If Statments
GetPlayerName(playerid, pName[playerid], MAX_PLAYER_NAME);
hOwner[hid] = dini_Int(hFile[hid], "hOwner");
So I am creating a house system, I need to see if the player's name equals the owner of
pawn Код:
What is the proper way to do this? |
if(!strcmp(hOwner[hid], pName[playerid], true)) {
if(strcmp("/lock", cmdtext, true, 5) == 0) {
new hid = 0;
while(hid < MAX_HOUSES) {
if(IsPlayerInRangeOfPoint(playerid, 5, hPickupX[hid], hPickupY[hid], hPickupZ[hid]) == 1) {
if(!strcmp(pName[playerid], hOwner[hid], true)) {
hLock[hid] = 1;
SendClientMessage(playerid, yellow, "Your House Was Locked");
}
else SendClientMessage(playerid, yellow, "You Can't Lock This House");
break;
}
hid++;
}
return 1;
}
if(strcmp("/unlock", cmdtext, true, 7) == 0) {
new hid = 0;
while(hid < MAX_HOUSES) {
if(IsPlayerInRangeOfPoint(playerid, 5, hPickupX[hid], hPickupY[hid], hPickupZ[hid]) == 1) {
if(!strcmp(pName[playerid], hOwner[hid], true)) {
hLock[hid] = 0;
SendClientMessage(playerid, yellow, "Your House Was Unlocked");
}
else SendClientMessage(playerid, yellow, "You Can't Unlock This House");
break;
}
hid++;
}
return 1;
}